:root {
  --bg: #f4f5f2;
  --panel: #ffffff;
  --line: #deded7;
  --text: #191919;
  --muted: #656860;
  --accent: #007f68;
  --accent-strong: #006553;
  --danger: #b42318;
  --warning: #946200;
  --radius: 8px;
  --sidebar-width: 286px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

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

.login-page {
  background: radial-gradient(circle at center, #333 0, #111 46%, #050505 100%);
}

/* Visual style adapted from Uiverse.io by glisovic01 */
.login-box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(400px, calc(100vw - 32px));
  padding: 40px;
  margin: 20px auto;
  transform: translate(-50%, -55%);
  background: rgba(0, 0, 0, .9);
  box-sizing: border-box;
  box-shadow: 0 15px 25px rgba(0, 0, 0, .6);
  border-radius: 10px;
}

.login-box > p:first-child {
  margin: 0 0 30px;
  padding: 0;
  color: #fff;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.login-box .user-box {
  position: relative;
}

.login-box .user-box input {
  width: 100%;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  margin-bottom: 30px;
  border: none;
  border-bottom: 1px solid #fff;
  outline: none;
  background: transparent;
}

.login-box .user-box label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  pointer-events: none;
  transition: .5s;
}

.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
  top: -20px;
  left: 0;
  color: #fff;
  font-size: 12px;
}

.login-box form button {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  margin-top: 40px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: bold;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: .5s;
  letter-spacing: 3px;
  cursor: pointer;
}

.login-box form button:hover,
.login-box form button:focus-visible {
  background: #fff;
  color: #272727;
  border-radius: 5px;
  outline: none;
}

.login-box form button span {
  position: absolute;
  display: block;
}

.login-box form button span:nth-child(1) {
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  animation: btn-anim1 1.5s linear infinite;
}

@keyframes btn-anim1 {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.login-box form button span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #fff);
  animation: btn-anim2 1.5s linear infinite;
  animation-delay: .375s;
}

@keyframes btn-anim2 {
  0% { top: -100%; }
  50%, 100% { top: 100%; }
}

.login-box form button span:nth-child(3) {
  bottom: 0;
  right: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #fff);
  animation: btn-anim3 1.5s linear infinite;
  animation-delay: .75s;
}

@keyframes btn-anim3 {
  0% { right: -100%; }
  50%, 100% { right: 100%; }
}

.login-box form button span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #fff);
  animation: btn-anim4 1.5s linear infinite;
  animation-delay: 1.125s;
}

@keyframes btn-anim4 {
  0% { bottom: -100%; }
  50%, 100% { bottom: 100%; }
}

.login-box .login-error {
  margin: -10px 0 0;
  color: #ffb4b4;
  font-size: 14px;
}

.dashboard-page {
  background: var(--bg);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 10px 24px;
  border-bottom: 1px solid #202020;
  background: #050505;
  color: #f7f7f7;
  backdrop-filter: blur(8px);
}

.sidebar-toggle {
  position: fixed;
  top: 18px;
  left: 24px;
  z-index: 40;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform .24s ease, background .2s ease, box-shadow .2s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: #1f1f1f;
  outline: none;
}

.sidebar-toggle span {
  display: block;
  width: 23px;
  height: 2px;
  border-radius: 999px;
  background: #f7f7f7;
  transition: transform .24s ease, opacity .18s ease;
}

.dashboard-page.sidebar-open .sidebar-toggle {
  transform: translateX(var(--sidebar-width));
  background: #0f0f0f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

.dashboard-page.sidebar-open .sidebar-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.dashboard-page.sidebar-open .sidebar-toggle span:nth-child(2) {
  opacity: 0;
  transform: translateX(-6px);
}

.dashboard-page.sidebar-open .sidebar-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.top-bar-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-user {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  justify-content: flex-end;
  color: #f7f7f7;
}

.logo-link {
  position: absolute;
  left: 88px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: var(--sidebar-width);
  border-right: 1px solid #202020;
  background: #050505;
  box-shadow: 18px 0 48px rgba(0, 0, 0, .24);
  transform: translateX(-100%);
  transition: transform .24s ease;
  padding: 88px 16px 20px;
}

.dashboard-page.sidebar-open .dashboard-sidebar {
  transform: translateX(0);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: #f7f7f7;
  font-size: .95rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-nav-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(214, 161, 75, .34));
}

.sidebar-nav-link span {
  min-width: 0;
}

.sidebar-nav-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-pending-badge {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--danger);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 10px rgba(180, 35, 24, .42);
}

.sidebar-pending-badge[hidden] {
  display: none;
}

.sidebar-nav-link:hover,
.sidebar-nav-link:focus-visible,
.sidebar-nav-link.is-active {
  background: #1f1f1f;
  outline: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.dashboard-page.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.reward-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  border: 0;
  padding: 24px;
  background: rgba(0, 0, 0, .97);
  color: #f4d99a;
  cursor: pointer;
}

.reward-overlay[hidden] {
  display: none;
}

.reward-popup {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: min(420px, calc(100vw - 40px));
  animation: reward-pop .26s ease-out;
}

.reward-popup-icon {
  display: block;
  width: min(190px, 48vw);
  max-height: 220px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 16px rgba(214, 161, 75, .54))
    drop-shadow(0 16px 24px rgba(0, 0, 0, .7));
}

.reward-overlay[data-variant="redemption-success"] .reward-popup-icon {
  width: min(280px, 66vw);
  max-height: min(320px, 48vh);
}

.reward-overlay[data-variant="no-money"] .reward-popup-icon {
  width: min(240px, 62vw);
  max-height: min(280px, 42vh);
}

.reward-popup-message {
  min-width: min(280px, calc(100vw - 56px));
  border: 1px solid rgba(214, 161, 75, .82);
  border-radius: var(--radius);
  padding: 12px 22px;
  background:
    linear-gradient(180deg, rgba(54, 38, 23, .96), rgba(18, 12, 8, .98)),
    #140f0b;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 182, .14),
    0 0 32px rgba(214, 161, 75, .22);
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(214, 161, 75, .38);
}

@keyframes reward-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.top-logo {
  display: block;
  width: 200px;
  height: auto;
  max-height: 98px;
  object-fit: contain;
}

.top-bar .ghost-button {
  border-color: #f7f7f7;
  color: #f7f7f7;
}

.top-bar .ghost-button:hover,
.top-bar .ghost-button:focus-visible {
  background: #1f1f1f;
}

.board-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.utility-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 24px 36px;
}

.utility-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.utility-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  background: var(--panel);
  font-weight: 700;
}

.currency-pill img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.utility-tabs {
  display: inline-flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  background: var(--panel);
}

.utility-tab {
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
}

.utility-tab:hover,
.utility-tab:focus-visible,
.utility-tab.is-active {
  color: #080604;
  background: var(--accent);
  outline: none;
}

.prize-shop {
  margin-top: 14px;
}

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

.prize-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 14px;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.prize-image-wrap {
  display: grid;
  place-items: center;
  min-height: 156px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, .1);
}

.prize-image {
  width: 100%;
  max-height: 156px;
  object-fit: contain;
}

.prize-info {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-width: 0;
}

.prize-info h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.prize-cost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text);
  background: rgba(255, 255, 255, .72);
  font-weight: 700;
}

.prize-cost img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.redemption-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.redemption-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
}

.redemption-row.is-history {
  grid-template-columns: 54px minmax(0, 1fr);
}

.redemption-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, .12);
}

.redemption-main {
  min-width: 0;
}

.redemption-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.redemption-title strong {
  overflow-wrap: anywhere;
}

.redemption-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: .86rem;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--muted);
  background: var(--panel);
}

#confirm-message {
  white-space: pre-line;
}

.performance-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 150px);
  min-height: 420px;
  overflow: hidden;
}

.performance-layout.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.employee-list-panel,
.performance-detail,
.review-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdfdfb;
}

.employee-list-panel,
.performance-detail {
  min-height: 0;
  overflow: hidden;
}

.employee-list {
  display: grid;
  align-content: start;
  gap: 6px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
}

.employee-list button,
.review-actions button {
  width: 100%;
}

.employee-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--text);
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.employee-list button strong,
.employee-list button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-list button small {
  color: var(--muted);
  font-size: .78rem;
}

.employee-list button:hover,
.employee-list button:focus-visible,
.employee-list button.is-active {
  border-color: var(--line);
  background: #eef5f1;
  outline: none;
}

.performance-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.performance-overview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.performance-history-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.performance-history-panel::before {
  content: "過往結算任務";
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.performance-history-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

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

.metric-box,
.history-row,
.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric-box {
  padding: 12px;
}

.metric-box span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.metric-box .metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.metric-box.is-currency .metric-label::before {
  content: "";
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background: url("../images/currency_icon.9b8c54d8ea19.png") center / contain no-repeat;
  filter: drop-shadow(0 0 7px rgba(214, 161, 75, .42));
}

.metric-box strong {
  display: block;
  margin-top: 5px;
  font-size: 1.25rem;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.history-row,
.review-card {
  padding: 12px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.history-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.history-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(130, 95, 48, .8);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(30, 22, 15, .74);
  color: #ead7ad;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.history-status-badge.is-positive {
  border-color: rgba(104, 181, 96, .78);
  background: linear-gradient(180deg, rgba(59, 112, 58, .26), rgba(19, 45, 29, .42));
  color: #a9ef9f;
  box-shadow: 0 0 10px rgba(104, 181, 96, .2);
  text-shadow: 0 0 8px rgba(120, 224, 111, .42);
}

.history-status-badge.is-negative {
  border-color: rgba(198, 72, 56, .84);
  background: linear-gradient(180deg, rgba(125, 39, 31, .3), rgba(52, 16, 13, .5));
  color: #ff9d90;
  box-shadow: 0 0 10px rgba(198, 72, 56, .24);
  text-shadow: 0 0 8px rgba(255, 118, 100, .42);
}

.history-status-badge.is-pending,
.history-status-badge.is-neutral {
  border-color: rgba(214, 161, 75, .72);
  background: linear-gradient(180deg, rgba(112, 78, 30, .28), rgba(45, 31, 14, .46));
  color: #f4d99a;
  box-shadow: 0 0 10px rgba(214, 161, 75, .18);
  text-shadow: 0 0 8px rgba(214, 161, 75, .28);
}

.history-row small,
.review-card small {
  color: var(--muted);
}

.review-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.review-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.review-card dl {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.review-card dt {
  color: var(--muted);
}

.review-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.board-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar-button,
.ghost-button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
}

.toolbar-button {
  background: var(--accent);
  color: #fff;
}

.toolbar-button:hover,
.toolbar-button:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.ghost-button {
  background: transparent;
  color: var(--accent);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: #e7f3ef;
  outline: none;
}

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

.board-column {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdfdfb;
}

.board-column h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 14px 14px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.2;
}

.board-status-icon {
  --icon-accent: #d6a14b;
  --icon-haze: rgba(214, 161, 75, .24);
  --icon-glow: rgba(214, 161, 75, .48);
  position: relative;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}

.board-status-icon::before,
.board-status-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.board-status-icon::before {
  inset: 3px;
  border: 1px solid rgba(244, 217, 154, .58);
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 48%, var(--icon-haze), transparent 62%),
    linear-gradient(135deg, rgba(255, 237, 184, .16), rgba(18, 11, 7, .95));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .5),
    0 0 12px var(--icon-glow);
  transform: rotate(45deg);
}

.board-status-icon::after {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.board-status-icon.is-pending::after {
  width: 12px;
  height: 15px;
  border-top: 2px solid var(--icon-accent);
  border-bottom: 2px solid var(--icon-accent);
  background:
    linear-gradient(135deg, transparent calc(50% - 1px), var(--icon-accent) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(45deg, transparent calc(50% - 1px), var(--icon-accent) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  filter: drop-shadow(0 0 5px var(--icon-glow));
}

.board-status-icon.is-active {
  --icon-accent: #dc6f35;
  --icon-haze: rgba(220, 111, 53, .27);
  --icon-glow: rgba(220, 111, 53, .52);
}

.board-status-icon.is-active::after {
  width: 13px;
  height: 17px;
  background:
    linear-gradient(180deg, #ffd98d 0%, var(--icon-accent) 45%, #7b2e21 100%);
  clip-path: polygon(50% 0, 69% 31%, 62% 100%, 38% 100%, 31% 31%);
  filter: drop-shadow(0 0 6px var(--icon-glow));
  transform: translate(-50%, -50%) rotate(18deg);
}

.board-status-icon.is-completed {
  --icon-accent: #7fca72;
  --icon-haze: rgba(127, 202, 114, .24);
  --icon-glow: rgba(127, 202, 114, .46);
}

.board-status-icon.is-completed::after {
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--icon-accent);
  border-bottom: 3px solid var(--icon-accent);
  filter: drop-shadow(0 0 5px var(--icon-glow));
  transform: translate(-50%, -64%) rotate(-45deg);
}

.task-list {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.task-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.task-card[data-urgency="urgent"] {
  border-left-color: var(--danger);
}

.task-card[data-urgency="medium"] {
  border-left-color: #ffd166;
}

.task-card[data-urgency="normal"] {
  border-left-color: #4f6f52;
}

.task-card:focus-visible,
.task-card.is-dragging {
  outline: 3px solid rgba(0, 127, 104, .22);
}

.task-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-card h3 {
  margin: 0;
  font-size: .98rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.assigner {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.task-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fafaf7;
  color: #30332e;
  font-size: .78rem;
  font-weight: 700;
}

.deadline-chip.is-overdue {
  border-color: #f4b5af;
  color: var(--danger);
  background: #fff1ef;
}

.deadline-chip.is-complete {
  color: var(--muted);
}

.completed-time {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.urgency-badge {
  flex: 0 0 auto;
  min-width: 44px;
  border-radius: 999px;
  padding: 3px 9px;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
}

.urgency-badge[data-urgency="urgent"] {
  color: #fff;
  background: var(--danger);
}

.urgency-badge[data-urgency="medium"] {
  color: #1c1400;
  background: #ffd166;
}

.urgency-badge[data-urgency="normal"] {
  color: #fff;
  background: #4f6f52;
}

.task-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #30332e;
  font-size: .9rem;
}

.task-detail dl {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0 0 10px;
}

.task-detail dt {
  color: var(--muted);
}

.task-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.child-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.child-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #fafaf7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tree-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
}

.tree-list .tree-list {
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.tree-node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #fff;
}

.drop-target {
  outline: 3px solid rgba(0, 127, 104, .2);
  outline-offset: -4px;
}

.action-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  box-shadow: 0 20px 80px rgba(0, 0, 0, .28);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.action-dialog::backdrop {
  background: rgba(0, 0, 0, .42);
}

.action-dialog h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.action-dialog p {
  margin: 0 0 18px;
  color: var(--muted);
}

.action-dialog form {
  display: grid;
  gap: 12px;
}

.action-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .9rem;
}

.action-dialog .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-dialog .checkbox-row input {
  width: auto;
}

.action-dialog input,
.action-dialog select,
.action-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
}

.action-dialog input,
.action-dialog textarea {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Dark fantasy visual pass: POE-adjacent mood without using game assets. */
.dashboard-page {
  --bg: #090807;
  --panel: rgba(28, 21, 15, .96);
  --line: #5a4528;
  --text: #f0e3c7;
  --muted: #b8a481;
  --accent: #b9822f;
  --accent-strong: #d6a14b;
  --danger: #b63a2e;
  --warning: #d4a63f;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 12%, rgba(157, 93, 30, .18), transparent 34rem),
    linear-gradient(rgba(4, 3, 2, .38), rgba(4, 3, 2, .76)),
    url("../images/dark_rpg_panel_bg.e994a525048d.png") center top / cover fixed,
    #090807;
}

.dashboard-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .48), transparent 18%, transparent 82%, rgba(0, 0, 0, .48)),
    repeating-linear-gradient(0deg, rgba(255, 244, 214, .025) 0 1px, transparent 1px 5px);
}

.dashboard-page .top-bar {
  border-bottom: 1px solid #7a5a2e;
  background:
    linear-gradient(180deg, rgba(29, 22, 15, .98), rgba(6, 5, 4, .98)),
    #080706;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .42);
}

.dashboard-page .dashboard-sidebar {
  border-right: 1px solid #7a5a2e;
  background:
    linear-gradient(180deg, rgba(22, 16, 11, .98), rgba(5, 4, 3, .98)),
    #070604;
  box-shadow: 22px 0 56px rgba(0, 0, 0, .55);
}

.dashboard-page .sidebar-toggle:hover,
.dashboard-page .sidebar-toggle:focus-visible,
.dashboard-page .sidebar-nav-link:hover,
.dashboard-page .sidebar-nav-link:focus-visible,
.dashboard-page .sidebar-nav-link.is-active,
.dashboard-page.sidebar-open .sidebar-toggle {
  background: linear-gradient(180deg, rgba(129, 89, 39, .42), rgba(24, 16, 10, .86));
}

.dashboard-page .sidebar-toggle span {
  background: #e9c778;
  box-shadow: 0 0 8px rgba(214, 161, 75, .42);
}

.dashboard-page .sidebar-backdrop {
  background: rgba(0, 0, 0, .46);
}

.dashboard-page .board-shell,
.dashboard-page .utility-panel {
  color: var(--text);
}

.dashboard-page .board-actions {
  border: 1px solid rgba(122, 90, 46, .78);
  border-radius: var(--radius);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(38, 27, 18, .94), rgba(15, 11, 8, .94));
  box-shadow: inset 0 1px 0 rgba(255, 232, 173, .12), 0 12px 34px rgba(0, 0, 0, .34);
}

.dashboard-page .toolbar-button,
.dashboard-page .ghost-button {
  border-color: #a67939;
  box-shadow: inset 0 1px 0 rgba(255, 235, 176, .18);
}

.dashboard-page .toolbar-button {
  color: #1a1007;
  background: linear-gradient(180deg, #d3a14d, #8f5d24);
}

.dashboard-page .toolbar-button:hover,
.dashboard-page .toolbar-button:focus-visible {
  color: #080604;
  background: linear-gradient(180deg, #edc777, #a96e2a);
}

.dashboard-page .ghost-button {
  color: #e5c886;
  background: rgba(12, 8, 5, .42);
}

.dashboard-page .ghost-button:hover,
.dashboard-page .ghost-button:focus-visible {
  background: rgba(98, 62, 29, .42);
}

.dashboard-page .board-column,
.dashboard-page .employee-list-panel,
.dashboard-page .performance-detail,
.dashboard-page .review-list {
  border-color: rgba(122, 90, 46, .84);
  background:
    linear-gradient(180deg, rgba(33, 25, 18, .94), rgba(13, 10, 8, .94)),
    rgba(13, 10, 8, .94);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 173, .11),
    inset 0 0 0 1px rgba(0, 0, 0, .42),
    0 18px 42px rgba(0, 0, 0, .32);
}

.dashboard-page .board-column h2,
.dashboard-page .utility-header h1 {
  color: #f4d99a;
  text-shadow: 0 1px 0 #000, 0 0 14px rgba(169, 92, 38, .28);
}

.dashboard-page .board-column h2 {
  border-bottom-color: rgba(122, 90, 46, .72);
  background: linear-gradient(180deg, rgba(55, 37, 21, .66), rgba(18, 12, 8, .5));
}

.dashboard-page .task-list {
  scrollbar-color: #8f5d24 #140f0b;
}

.dashboard-page .task-card,
.dashboard-page .metric-box,
.dashboard-page .history-row,
.dashboard-page .review-card,
.dashboard-page .prize-card,
.dashboard-page .redemption-row,
.dashboard-page .empty-state,
.dashboard-page .currency-pill,
.dashboard-page .utility-tabs,
.dashboard-page .tree-node,
.dashboard-page .child-item {
  border-color: rgba(130, 95, 48, .86);
  background:
    linear-gradient(180deg, rgba(44, 33, 22, .98), rgba(24, 18, 13, .98)),
    #1b130d;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 182, .12),
    0 8px 20px rgba(0, 0, 0, .28);
}

.dashboard-page .task-card {
  border-left-color: #8f5d24;
}

.dashboard-page .task-card[data-urgency="urgent"] {
  border-left-color: #c64838;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 182, .1),
    0 0 0 1px rgba(198, 72, 56, .18),
    0 8px 22px rgba(0, 0, 0, .3);
}

.dashboard-page .task-card[data-urgency="medium"] {
  border-left-color: #d6a14b;
}

.dashboard-page .task-card[data-urgency="normal"] {
  border-left-color: #6f8a5f;
}

.dashboard-page .task-card:focus-visible,
.dashboard-page .task-card.is-dragging,
.dashboard-page .drop-target {
  outline-color: rgba(214, 161, 75, .36);
}

.dashboard-page .task-card h3,
.dashboard-page .prize-info h3,
.dashboard-page .redemption-title strong,
.dashboard-page .tree-node strong,
.dashboard-page .review-card h3,
.dashboard-page .history-row strong {
  color: #f5e2b8;
}

.dashboard-page .assigner,
.dashboard-page .completed-time,
.dashboard-page .task-detail dt,
.dashboard-page .metric-box span,
.dashboard-page .redemption-meta,
.dashboard-page .empty-state,
.dashboard-page .history-row small,
.dashboard-page .review-card small,
.dashboard-page .review-card dt,
.dashboard-page .action-dialog p,
.dashboard-page .action-dialog label {
  color: var(--muted);
}

.dashboard-page .task-meta span {
  border-color: rgba(130, 95, 48, .82);
  color: #e9c778;
  background: linear-gradient(180deg, rgba(42, 29, 17, .96), rgba(15, 10, 7, .96));
}

.dashboard-page .prize-cost {
  border-color: rgba(130, 95, 48, .82);
  color: #e9c778;
  background: linear-gradient(180deg, rgba(42, 29, 17, .96), rgba(15, 10, 7, .96));
}

.dashboard-page .prize-image-wrap,
.dashboard-page .redemption-icon {
  background: radial-gradient(circle at center, rgba(214, 161, 75, .12), rgba(0, 0, 0, .32));
}

.dashboard-page .utility-tab {
  color: var(--muted);
}

.dashboard-page .utility-tab:hover,
.dashboard-page .utility-tab:focus-visible,
.dashboard-page .utility-tab.is-active {
  color: #080604;
  background: linear-gradient(180deg, #edc777, #a96e2a);
}

.dashboard-page .deadline-chip.is-overdue {
  border-color: rgba(198, 72, 56, .9);
  color: #ffb2a8;
  background: rgba(93, 24, 19, .45);
}

.dashboard-page .deadline-chip.is-complete {
  color: #c7b38b;
}

.dashboard-page .urgency-badge[data-urgency="urgent"] {
  color: #fff2e3;
  background: linear-gradient(180deg, #b74435, #681b18);
}

.dashboard-page .urgency-badge[data-urgency="medium"] {
  color: #1a1007;
  background: linear-gradient(180deg, #e4bc5d, #a8732d);
}

.dashboard-page .urgency-badge[data-urgency="normal"] {
  color: #f5f1df;
  background: linear-gradient(180deg, #70865d, #3e4f37);
}

.dashboard-page .task-detail,
.dashboard-page .tree-list .tree-list {
  border-color: rgba(122, 90, 46, .62);
}

.dashboard-page .task-detail,
.dashboard-page .task-detail dd,
.dashboard-page .tree-node,
.dashboard-page .tree-node div,
.dashboard-page .review-card dd,
.dashboard-page .history-row,
.dashboard-page .history-list p,
.dashboard-page .performance-detail > p {
  color: #ead7ad;
}

.dashboard-page .performance-history-panel {
  border-top-color: rgba(122, 90, 46, .72);
}

.dashboard-page .performance-history-panel::before {
  color: #f4d99a;
  text-shadow: 0 1px 0 #000;
}

.dashboard-page .metric-box strong {
  color: #f4d99a;
}

.dashboard-page .employee-list,
.dashboard-page .performance-history-scroll {
  scrollbar-color: #a66f2e #140f0b;
}

.dashboard-page .employee-list button {
  color: var(--text);
}

.dashboard-page .employee-list button:hover,
.dashboard-page .employee-list button:focus-visible,
.dashboard-page .employee-list button.is-active {
  border-color: rgba(166, 121, 57, .9);
  background: linear-gradient(180deg, rgba(85, 55, 25, .48), rgba(26, 18, 12, .82));
}

.dashboard-page .action-dialog {
  border: 1px solid rgba(166, 121, 57, .9);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(42, 30, 19, .98), rgba(16, 11, 8, .98)),
    #17110c;
  box-shadow: 0 26px 96px rgba(0, 0, 0, .62);
}

.dashboard-page .action-dialog::backdrop {
  background: rgba(0, 0, 0, .7);
}

.dashboard-page .action-dialog h3 {
  color: #f4d99a;
}

.dashboard-page .action-dialog input,
.dashboard-page .action-dialog select,
.dashboard-page .action-dialog textarea {
  border-color: rgba(130, 95, 48, .88);
  color: #f0e3c7;
  background: #100c09;
}

.dashboard-page .action-dialog input[type="datetime-local"] {
  color-scheme: dark;
}

.dashboard-page .action-dialog input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  filter:
    invert(75%)
    sepia(57%)
    saturate(672%)
    hue-rotate(356deg)
    brightness(100%)
    contrast(91%)
    drop-shadow(0 0 4px rgba(214, 161, 75, .52));
}

.dashboard-page .action-dialog input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  filter:
    invert(88%)
    sepia(44%)
    saturate(574%)
    hue-rotate(352deg)
    brightness(105%)
    contrast(95%)
    drop-shadow(0 0 6px rgba(237, 199, 119, .72));
}

.dashboard-page .action-dialog input:focus,
.dashboard-page .action-dialog select:focus,
.dashboard-page .action-dialog textarea:focus {
  border-color: #d6a14b;
  outline: 2px solid rgba(214, 161, 75, .22);
}

@media (max-width: 767px) {
  :root {
    --sidebar-width: min(82vw, 286px);
  }

  .login-box {
    padding: 32px 24px;
    transform: translate(-50%, -50%);
  }

  .top-bar {
    grid-template-columns: auto 1fr auto;
    padding: 8px 12px;
  }

  .sidebar-toggle {
    top: 14px;
    left: 12px;
  }

  .logo-link {
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .top-logo {
    width: min(200px, calc(100vw - 168px));
    max-height: 60px;
  }

  .top-bar-user span {
    display: none;
  }

  .board-shell {
    padding: 12px 0 24px;
  }

  .utility-panel {
    padding: 14px 12px 24px;
  }

  .performance-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 96px minmax(0, 1fr);
    gap: 10px;
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    min-height: 0;
  }

  .performance-layout.is-single {
    grid-template-rows: minmax(0, 1fr);
  }

  .metric-grid,
  .status-summary {
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 38vw);
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .performance-detail {
    grid-template-rows: auto minmax(180px, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .performance-overview {
    gap: 8px;
  }

  .performance-history-panel {
    padding-top: 8px;
  }

  .metric-box {
    min-height: 58px;
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  .metric-box span {
    font-size: .75rem;
  }

  .metric-box strong {
    margin-top: 3px;
    font-size: 1.05rem;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .utility-header {
    align-items: flex-start;
    gap: 10px;
  }

  .currency-pill {
    min-height: 32px;
    padding: 5px 10px;
  }

  .utility-tabs {
    width: 100%;
  }

  .utility-tab {
    flex: 1 1 0;
    padding: 8px 10px;
  }

  .prize-grid {
    grid-template-columns: 1fr;
  }

  .prize-card {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 150px;
    gap: 10px;
  }

  .prize-image-wrap {
    min-height: 126px;
  }

  .prize-image {
    max-height: 126px;
  }

  .redemption-row,
  .redemption-row.is-history {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
  }

  .redemption-row .toolbar-button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .redemption-icon {
    width: 46px;
    height: 46px;
  }

  .board-actions {
    padding: 0 12px;
  }

  .board {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .board-column {
    flex: 0 0 88vw;
    height: calc(100vh - 130px);
    min-height: 440px;
    margin-left: 12px;
    scroll-snap-align: center;
  }

  .board-column:last-child {
    margin-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-box form button span {
    animation: none;
  }
}
