:root {
  color-scheme: dark;
  --log-bg: #080b13;
  --log-panel: rgba(16, 22, 35, 0.82);
  --log-border: rgba(148, 163, 184, 0.12);
  --log-muted: #8290a6;
  --log-text: #e9eef7;
  --log-violet: #a78bfa;
  --log-cyan: #67e8f9;
}

body.logduty-page {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 12% -10%, rgba(81, 55, 159, 0.25), transparent 38rem),
    radial-gradient(ellipse at 95% 18%, rgba(14, 116, 144, 0.12), transparent 32rem),
    var(--log-bg);
  color: var(--log-text);
}

body.logduty-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(184, 197, 220, 0.12) 0.6px, transparent 0.6px);
  background-size: 24px 24px;
  content: "";
  opacity: 0.2;
  pointer-events: none;
}

.logduty-shell { position: relative; }
.logduty-topbar {
  min-height: 78px;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.brand-lockup { color: inherit; text-decoration: none; }
.brand-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(124, 89, 219, 0.24), rgba(18, 26, 43, 0.9));
  color: #d8ccff;
  font-size: 18px;
  box-shadow: 0 9px 30px rgba(88, 56, 170, 0.16);
}
.brand-mark img { position: absolute; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.brand-mark i { position: relative; z-index: 0; }
.brand-lockup > span:last-child { display: grid; gap: 4px; }
.brand-lockup strong { color: #f1edff; font-size: 15px; letter-spacing: 0.11em; }
.brand-lockup > span:last-child > span { color: #78869d; font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }
.brand-lockup > span:last-child i { margin: 0 4px; color: var(--log-violet); }
.topbar-link {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--log-border);
  border-radius: 11px;
  background: rgba(18, 25, 40, 0.72);
  color: #b3bfd0;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.topbar-link:hover { border-color: rgba(167, 139, 250, 0.44); background: rgba(124, 89, 219, 0.13); color: #e4dcff; }
.topbar-link i { color: var(--log-violet); }
.logout-link i { color: #fda4af; }

.logduty-hero {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(110deg, rgba(22, 26, 48, 0.97) 0%, rgba(19, 25, 43, 0.94) 58%, rgba(17, 37, 51, 0.88) 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.035);
}
.logduty-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.05), transparent 55%, rgba(103, 232, 249, 0.05));
  content: "";
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 34px 38px; }
.hero-eyebrow { display: flex; align-items: center; gap: 9px; color: #b8a6ff; font-size: 9px; font-weight: 800; letter-spacing: 0.19em; }
.live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 99px; background: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.65); }
.hero-content h1 { margin: 15px 0 8px; color: #f5f3ff; font-size: clamp(27px, 4vw, 39px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.15; }
.hero-content h1 span { color: #b9a5ff; }
.hero-content > p { max-width: 690px; margin: 0; color: #9aa7bb; font-size: 12px; line-height: 1.8; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.28);
  color: #bac5d5;
  font-size: 9px;
  font-weight: 700;
}
.hero-badges i { color: #b8a6ff; }
.hero-emblem {
  position: absolute;
  top: 50%;
  right: 8%;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  transform: translateY(-50%) rotate(-10deg);
  border: 1px solid rgba(194, 181, 253, 0.16);
  border-radius: 49px;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.12), rgba(103, 232, 249, 0.025));
  color: rgba(198, 184, 255, 0.2);
  font-size: 84px;
  box-shadow: 0 0 80px rgba(139, 92, 246, 0.12), inset 0 1px rgba(255, 255, 255, 0.08);
}
.hero-emblem span { position: absolute; right: 15px; bottom: 12px; color: rgba(226, 232, 240, 0.55); font-size: 13px; font-weight: 900; letter-spacing: 0.2em; }
.hero-orb { position: absolute; width: 270px; height: 270px; border-radius: 100%; filter: blur(1px); pointer-events: none; }
.hero-orb-one { top: -190px; right: 18%; background: rgba(139, 92, 246, 0.1); }
.hero-orb-two { right: -100px; bottom: -230px; background: rgba(34, 211, 238, 0.08); }

.toolbar-panel, .report-panel, .metric-card {
  border: 1px solid var(--log-border);
  background: var(--log-panel);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}
.toolbar-panel { padding: 18px 20px; border-radius: 16px; }
.toolbar-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.toolbar-icon, .report-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(167, 139, 250, 0.2); border-radius: 11px; background: rgba(139, 92, 246, 0.11); color: #c4b5fd; font-size: 13px; }
.toolbar-heading > span:last-child, .report-title-group > span:last-child { display: grid; gap: 3px; }
.toolbar-heading strong, .report-title-group strong { color: #e7edf7; font-size: 12px; }
.toolbar-heading small, .report-title-group small { color: #77869c; font-size: 9px; }
.filter-controls { display: grid; grid-template-columns: minmax(180px, 0.72fr) minmax(190px, 0.8fr) minmax(220px, 1.2fr) auto; align-items: end; gap: 12px; }
.week-field { display: grid; gap: 6px; color: #a9b5c8; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; }
.input-wrap, .search-field { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 10px; background: rgba(6, 11, 20, 0.55); transition: border-color 150ms ease, box-shadow 150ms ease; }
.input-wrap:focus-within, .search-field:focus-within { border-color: rgba(167, 139, 250, 0.65); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
.input-wrap i, .search-field > i { color: #8f9bb0; font-size: 11px; }
.input-wrap input, .search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #e5eaf4; font-size: 11px; color-scheme: dark; }
.week-range { display: flex; min-height: 42px; align-items: center; gap: 9px; margin: 0; color: #91a1b8; font-size: 10px; }
.week-range i { color: #72d8cf; }
.search-field { min-width: 0; }
.search-field input::placeholder { color: #65738a; }
.search-field kbd { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 5px; color: #718096; font: inherit; font-size: 10px; }
.apply-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid rgba(196, 181, 253, 0.35); border-radius: 10px; background: linear-gradient(135deg, #8b72e8, #6e58c9); color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 7px 20px rgba(108, 82, 204, 0.22); transition: filter 150ms ease, transform 150ms ease; }
.apply-button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.apply-button:disabled, .refresh-button:disabled { cursor: wait; opacity: 0.6; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 132px; overflow: hidden; padding: 17px 19px; border-radius: 15px; }
.metric-card::after { position: absolute; top: -40px; right: -28px; width: 118px; height: 118px; border: 1px solid currentColor; border-radius: 100%; content: ""; opacity: 0.08; }
.metric-total { color: #5eead4; }
.metric-staff { color: #a5b4fc; }
.metric-shifts { color: #67e8f9; }
.metric-topline { display: flex; align-items: center; justify-content: space-between; color: #94a2b7; font-size: 9px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid currentColor; border-radius: 10px; background: currentColor; font-size: 12px; }
.metric-icon i { filter: brightness(1.5); }
.metric-total .metric-icon { color: rgba(45, 212, 191, 0.15); }
.metric-total .metric-icon i { color: #5eead4; }
.metric-staff .metric-icon { color: rgba(129, 140, 248, 0.15); }
.metric-staff .metric-icon i { color: #a5b4fc; }
.metric-shifts .metric-icon { color: rgba(34, 211, 238, 0.14); }
.metric-shifts .metric-icon i { color: #67e8f9; }
.metric-card > strong { display: block; margin-top: 8px; color: #f0f5fb; font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card > small { display: block; margin-top: 5px; color: #78869c; font-size: 9px; }

.report-panel { overflow: hidden; border-radius: 17px; }
.report-heading { display: flex; min-height: 75px; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 19px; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.report-title-group { display: flex; min-width: 0; align-items: center; gap: 11px; }
.report-icon { width: 37px; height: 37px; color: #74e3d7; border-color: rgba(94, 234, 212, 0.17); background: rgba(45, 212, 191, 0.09); }
.report-title-group small { max-width: 74vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-actions { display: flex; align-items: center; gap: 10px; }
.discord-source { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid rgba(129, 140, 248, 0.18); border-radius: 8px; background: rgba(99, 102, 241, 0.08); color: #c1c7ff; font-size: 8px; font-weight: 900; letter-spacing: 0.1em; white-space: nowrap; }
.discord-source .live-dot { width: 6px; height: 6px; }
.refresh-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--log-border); border-radius: 9px; background: rgba(255, 255, 255, 0.025); color: #aebacf; transition: border-color 150ms ease, color 150ms ease, transform 150ms ease; }
.refresh-button:hover { transform: rotate(25deg); border-color: rgba(103, 232, 249, 0.4); color: var(--log-cyan); }
.report-status { display: flex; min-height: 39px; align-items: center; gap: 8px; padding: 0 20px; border-bottom: 1px solid rgba(148, 163, 184, 0.065); }
.status-indicator { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 99px; background: #8b9bb2; }
.report-status:has(#loadStatus.text-emerald-300) .status-indicator { background: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.55); }
.report-status:has(#loadStatus.text-rose-300) .status-indicator { background: #fb7185; box-shadow: 0 0 10px rgba(251, 113, 133, 0.5); }
.report-status p { margin: 0; overflow: hidden; color: #8795aa; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.report-status:has(#loadStatus[data-state="loading"]) .status-indicator { background: #a78bfa; box-shadow: 0 0 10px rgba(167, 139, 250, 0.55); animation: status-pulse 1.1s ease-in-out infinite; }
.report-status:has(#loadStatus[data-state="success"]) .status-indicator { background: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.55); }
.report-status:has(#loadStatus[data-state="warning"]) .status-indicator { background: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
.report-status:has(#loadStatus[data-state="error"]) .status-indicator { background: #fb7185; box-shadow: 0 0 10px rgba(251, 113, 133, 0.5); }
@keyframes status-pulse { 50% { opacity: 0.38; transform: scale(0.75); } }
.logduty-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.logduty-table th:nth-child(1), .logduty-table td:nth-child(1) { width: 54px; }
.logduty-table th:nth-child(2), .logduty-table td:nth-child(2) { width: 30%; }
.logduty-table th:nth-child(3), .logduty-table td:nth-child(3) { width: 29%; }
.logduty-table th:nth-child(4), .logduty-table td:nth-child(4) { width: 76px; }
.logduty-table th:nth-child(5), .logduty-table td:nth-child(5) { width: 125px; }
.logduty-table th:nth-child(6), .logduty-table td:nth-child(6) { width: 150px; }
.logduty-table thead { background: rgba(8, 13, 23, 0.72); }
.logduty-table th { color: #8290a6; font-size: 8px; font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; white-space: nowrap; }
.logduty-table tbody tr { transition: background 140ms ease; }
.logduty-table tbody tr:hover { background: rgba(167, 139, 250, 0.045); }
.logduty-table tbody td { border-top: 1px solid rgba(148, 163, 184, 0.075); font-size: 10px; }
.logduty-table tbody tr:first-child td { border-top-color: transparent; }
.rank-cell span { display: inline-grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(148, 163, 184, 0.11); border-radius: 8px; background: rgba(255, 255, 255, 0.025); color: #7b8aa0; font-size: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.player-cell { display: flex; width: 100%; min-width: 0; align-items: center; gap: 10px; }
.player-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(167, 139, 250, 0.18); border-radius: 10px; background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(24, 32, 50, 0.9)); color: #c9bdff; font-size: 9px; font-weight: 900; letter-spacing: 0.04em; }
.player-name { min-width: 0; overflow-wrap: anywhere; color: #e7edf7; font-size: 11px; font-weight: 700; line-height: 1.55; }
.license-chip { display: inline-flex; max-width: 220px; align-items: center; gap: 7px; padding: 6px 8px; overflow: hidden; border: 1px solid rgba(167, 139, 250, 0.16); border-radius: 7px; background: rgba(139, 92, 246, 0.075); color: #c4b5fd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.license-chip i { flex: 0 0 auto; color: #9b8aed; font-size: 9px; }
.shift-chip { display: inline-grid; min-width: 27px; height: 25px; place-items: center; border: 1px solid rgba(103, 232, 249, 0.16); border-radius: 8px; background: rgba(34, 211, 238, 0.07); color: #a5f3fc; font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; }
.total-time { color: #5eead4; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.last-duty { display: inline-flex; align-items: center; gap: 7px; color: #93a0b5; white-space: nowrap; }
.last-duty i { color: #75d6c7; font-size: 10px; }
.empty-state { padding: 50px 20px !important; text-align: center; }
.empty-state > span { display: grid; width: 42px; height: 42px; margin: 0 auto 12px; place-items: center; border: 1px solid rgba(167, 139, 250, 0.18); border-radius: 14px; background: rgba(139, 92, 246, 0.08); color: #b3a2ff; font-size: 15px; }
.empty-state strong, .empty-state small { display: block; }
.empty-state strong { color: #dbe3ef; font-size: 11px; }
.empty-state small { margin-top: 5px; color: #78869c; font-size: 9px; }
.report-footer { display: flex; min-height: 39px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 19px; border-top: 1px solid rgba(148, 163, 184, 0.09); color: #68778d; font-size: 8px; }
.report-footer span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.report-footer i { color: #8c7ce0; }
.privacy-note { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 2px 3px; color: #74839a; font-size: 9px; line-height: 1.7; }
.privacy-note i { margin-top: 2px; color: #8a7be1; }
.logduty-footer { display: flex; justify-content: space-between; gap: 15px; padding: 15px 0 4px; border-top: 1px solid rgba(148, 163, 184, 0.1); color: #58667b; font-size: 8px; letter-spacing: 0.11em; }
.logduty-footer strong { color: #97a5ba; }

@media (max-width: 900px) {
  .filter-controls { grid-template-columns: minmax(160px, 0.8fr) minmax(190px, 1fr) auto; }
  .week-range { grid-column: 1 / -1; grid-row: 2; min-height: auto; }
  .search-field { grid-column: 1 / 3; grid-row: 3; }
  .apply-button { grid-column: 3; grid-row: 3; }
  .hero-emblem { right: 5%; width: 135px; height: 135px; font-size: 63px; }
  .hero-content { max-width: 72%; }
}

@media (max-width: 640px) {
  .logduty-topbar { min-height: auto; padding-bottom: 14px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand-lockup strong { font-size: 13px; }
  .brand-lockup > span:last-child > span { font-size: 7px; }
  .topbar-link { min-height: 35px; padding: 0 10px; font-size: 10px; }
  .logduty-hero { min-height: 0; border-radius: 17px; }
  .hero-content { max-width: 100%; padding: 25px 20px; }
  .hero-content h1 { max-width: 360px; font-size: 29px; }
  .hero-content > p { max-width: 440px; font-size: 11px; }
  .hero-badges { gap: 6px; margin-top: 15px; }
  .hero-badges span { padding: 6px 8px; font-size: 8px; }
  .hero-emblem { top: 12px; right: 10px; width: 58px; height: 58px; transform: rotate(8deg); border-radius: 18px; font-size: 27px; opacity: 0.55; }
  .hero-emblem span { right: 5px; bottom: 3px; font-size: 7px; }
  .toolbar-panel { padding: 15px; border-radius: 14px; }
  .filter-controls { grid-template-columns: 1fr auto; gap: 10px; }
  .week-field { grid-column: 1 / -1; }
  .week-range { grid-column: 1 / -1; grid-row: auto; padding: 0 2px; }
  .search-field { grid-column: 1 / -1; grid-row: auto; }
  .apply-button { grid-column: 1 / -1; grid-row: auto; }
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 117px; padding: 13px; border-radius: 12px; }
  .metric-card:last-child { grid-column: 1 / -1; min-height: 100px; }
  .metric-card > strong { font-size: 24px; }
  .metric-topline { font-size: 8px; letter-spacing: 0.07em; }
  .metric-topline .metric-icon { width: 27px; height: 27px; }
  .metric-card > small { max-width: 170px; font-size: 8px; }
  .report-heading { align-items: flex-start; padding: 13px; }
  .report-title-group { gap: 8px; }
  .report-title-group strong { font-size: 10px; }
  .report-title-group small { max-width: 55vw; font-size: 8px; }
  .report-icon { width: 32px; height: 32px; }
  .discord-source { gap: 5px; padding: 6px; font-size: 7px; }
  .report-actions { gap: 6px; }
  .refresh-button { width: 31px; height: 31px; }
  .report-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 9px 13px; font-size: 8px; }
  .license-chip { max-width: 175px; }
  .logduty-footer { font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
