:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;
  --ink: #111111;
  --muted: #74706a;
  --line: #d9d5ce;
  --vip: #b08d57;
  --vip-strong: #87683d;
  --nav: #050505;
  --nav-ink: #f7f6f2;
  --nav-muted: #c0c0c0;
  --accent: #b76e79;
  --danger: #8f3f4f;
  --good: #87683d;
  --radius: 8px;
  --shadow: 0 18px 46px rgba(18, 28, 45, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --panel: #151515;
  --panel-soft: #1d1b1b;
  --ink: #ffffff;
  --muted: #c0c0c0;
  --line: #383433;
  --vip: #d4af37;
  --vip-strong: #f1d177;
  --nav: #000000;
  --nav-ink: #ffffff;
  --nav-muted: #c0c0c0;
  --accent: #b76e79;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--vip);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(176, 141, 87, 0.28);
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--nav);
  color: var(--nav-ink);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  color: var(--nav-muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--nav-ink);
  min-height: 40px;
  padding: 9px 10px;
  border-radius: var(--radius);
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.09);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--nav-muted);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-chip {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--nav-muted);
  font-size: 13px;
}

.user-chip strong {
  display: block;
  color: var(--nav-ink);
  margin-bottom: 3px;
}

.main {
  min-width: 0;
  padding: 26px;
}

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

.page-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.muted {
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
}

.btn:hover {
  border-color: var(--vip);
}

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

.btn.primary {
  background: var(--vip);
  border-color: var(--vip);
  color: #fff;
}

.btn.primary:hover {
  background: var(--vip-strong);
}

.btn.warn {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

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

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

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(18, 28, 45, 0.04);
}

.panel-header {
  padding: 16px 16px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-body {
  padding: 16px;
}

.metric {
  min-height: 122px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value {
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.metric-foot {
  color: var(--muted);
  font-size: 13px;
}

.metric.good .metric-foot {
  color: var(--good);
  font-weight: 800;
}

.metric.warn .metric-foot {
  color: #8a5c00;
  font-weight: 800;
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--vip);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.18);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow-wrap: break-word;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--panel-soft);
  color: var(--muted);
}

.status-pill.good {
  background: rgba(176, 141, 87, 0.16);
  color: var(--good);
}

.status-pill.warn {
  background: rgba(183, 110, 121, 0.16);
  color: #8f3f4f;
}

.status-pill.danger {
  background: rgba(143, 63, 79, 0.12);
  color: var(--danger);
}

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

.quick-action {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  text-decoration: none;
  color: var(--ink);
}

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

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

.discord-launch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.config-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.config-row {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.config-row:last-child {
  border-bottom: 0;
}

.copy-field,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.copy-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
}

.login-brand {
  background: var(--nav);
  color: var(--nav-ink);
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}

.login-brand h1 {
  font-size: 42px;
  max-width: 520px;
}

.login-brand p {
  color: var(--nav-muted);
  max-width: 520px;
  line-height: 1.6;
}

.login-main {
  display: grid;
  place-items: center;
  padding: 34px;
}

.login-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 1;
  border: 0;
  border-radius: var(--radius);
  padding: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--vip);
}

.message {
  border: 1px solid var(--line);
  border-left: 4px solid var(--vip);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--muted);
  margin-bottom: 14px;
}

.message.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.employee-clock {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.clock-face {
  min-height: 300px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 22px;
  border-top: 4px solid var(--vip);
}

.clock-time {
  font-size: 44px;
  font-weight: 900;
}

.clock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clock-actions .btn {
  min-height: 54px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.map-draw {
  display: grid;
  gap: 10px;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-canvas {
  position: relative;
  height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #d8d4ce;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.map-tiles {
  position: absolute;
  inset: 0;
}

.map-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
}

.map-selection {
  position: absolute;
  display: none;
  border: 2px solid var(--accent);
  background: rgba(183, 110, 121, 0.22);
  box-shadow: 0 0 0 9999px rgba(5, 5, 5, 0.18);
  pointer-events: none;
}

.map-instructions {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 12px;
  font-weight: 800;
}

.map-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 20px;
}

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

.modal {
  width: min(560px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.hide {
  display: none !important;
}

@media (max-width: 980px) {
  .layout,
  .login-layout,
  .employee-clock,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .layout {
    min-height: 0;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 18px;
  }

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

@media (max-width: 620px) {
  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .clock-actions,
  .form-grid.two,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .clock-time {
    font-size: 34px;
  }

  .login-brand {
    padding: 26px;
  }

  .login-brand h1 {
    font-size: 34px;
  }
}
