:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;
  --ink: #111111;
  --muted: #687082;
  --line: #d7dce8;
  --vip: #4d8cff;
  --vip-strong: #2f6ee9;
  --nav: #070a13;
  --nav-ink: #f7f6f2;
  --nav-muted: #aab3c5;
  --accent: #7392ff;
  --danger: #9d4258;
  --good: #2f6ee9;
  --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: #1b1f2d;
  --ink: #ffffff;
  --muted: #b6bed0;
  --line: #32384c;
  --vip: #69a1ff;
  --vip-strong: #8bb7ff;
  --nav: #000000;
  --nav-ink: #ffffff;
  --nav-muted: #aab3c5;
  --accent: #7392ff;
  --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: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0;
}

.client-logo {
  width: auto;
  max-width: 150px;
  max-height: 38px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
}

.client-logo.dark {
  margin: 0 0 0 12px;
  padding: 7px;
  max-width: 110px;
  max-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.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;
}

.powered-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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: var(--danger);
  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(77, 140, 255, 0.2);
}

.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(77, 140, 255, 0.16);
  color: var(--good);
}

.status-pill.warn {
  background: rgba(115, 146, 255, 0.16);
  color: var(--accent);
}

.status-pill.danger {
  background: rgba(157, 66, 88, 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;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .btn {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  text-transform: none;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: auto;
}

.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;
}

.checklist,
.exception-list {
  display: grid;
  gap: 10px;
}

.checklist-item,
.exception-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.checklist-item span:first-child {
  width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(115, 146, 255, 0.14);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.checklist-item.done span:first-child {
  background: rgba(77, 140, 255, 0.18);
  color: var(--good);
}

.checklist-item strong,
.exception-item strong {
  display: block;
  margin-bottom: 2px;
}

.checklist-item small,
.exception-item small {
  color: var(--muted);
  line-height: 1.4;
}

.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;
  width: 100%;
  background: #fff;
}

.login-showcase {
  display: grid;
  grid-template-columns: minmax(440px, 0.82fr) minmax(440px, 0.6fr);
  padding: 18px;
  background: #f6f6f4;
}

.login-photo-panel {
  position: relative;
  min-height: calc(100vh - 36px);
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(2, 5, 13, 0.18), rgba(2, 5, 13, 0.04)),
    url("/assets/ecc-slice.png") center / cover no-repeat;
  color: #fff;
}

.login-photo-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(2, 5, 13, 0.7) 0%, rgba(2, 5, 13, 0.34) 50%, rgba(2, 5, 13, 0.06) 100%),
    linear-gradient(180deg, rgba(2, 5, 13, 0.04) 0%, rgba(2, 5, 13, 0.12) 40%, rgba(2, 5, 13, 0.78) 100%);
  pointer-events: none;
}

.login-photo-content {
  position: relative;
  z-index: 3;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 48px;
  padding: 72px;
}

.login-photo-content::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 58%;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(2, 5, 13, 0.84) 0%, rgba(2, 5, 13, 0.64) 56%, rgba(2, 5, 13, 0) 100%),
    linear-gradient(0deg, rgba(2, 5, 13, 0.88) 0%, rgba(2, 5, 13, 0) 100%);
  pointer-events: none;
}

.login-photo-content > * {
  position: relative;
  z-index: 1;
}

.login-photo-kicker {
  display: block;
  color: var(--vip);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.62);
}

.login-photo-content h1 {
  margin: 14px 0 0;
  max-width: 560px;
  font-size: 38px;
  line-height: 1.2;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.74);
}

.login-photo-content p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.55;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.72);
}

.login-photo-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.login-photo-feature {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.login-photo-icon {
  width: 38px;
  height: 38px;
  color: var(--vip);
}

.login-photo-icon svg {
  width: 100%;
  height: 100%;
}

.login-photo-feature strong,
.login-photo-feature span {
  display: block;
}

.login-photo-feature strong {
  font-size: 13px;
}

.login-photo-feature span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.55;
}

.login-auth-panel {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
  padding: 34px;
  background: #fff;
  border-radius: 0 16px 16px 0;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
}

.login-auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 30px;
}

.login-logo-frame {
  width: min(430px, 100%);
  height: 220px;
  display: grid;
  place-items: center;
  justify-self: center;
  overflow: hidden;
}

.login-logo {
  width: 520px;
  max-width: none;
  height: auto;
  display: block;
  border-radius: 0;
  box-shadow: none;
  transform: translateX(-2%);
}

.login-tabs {
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.login-tabs .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 0;
  padding: 14px 10px;
  color: #4f5b70;
}

.login-tabs .tab.active {
  background: transparent;
  color: var(--vip-strong);
  box-shadow: inset 0 -3px 0 var(--vip-strong);
}

.tab-icon,
.login-gps-icon,
.login-secure-note span {
  width: 20px;
  height: 20px;
  display: inline-flex;
  color: currentColor;
}

.tab-icon svg,
.login-gps-icon svg,
.login-secure-note svg {
  width: 100%;
  height: 100%;
}

.login-form-wrap {
  display: grid;
  gap: 22px;
}

.login-form {
  gap: 18px;
}

.login-form label {
  color: #4f5b70;
}

.login-form input,
.login-form select {
  height: 56px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  text-transform: none;
  color: #364154;
}

.login-form .btn.primary {
  min-height: 58px;
  font-size: 17px;
}

.login-gps-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: #eef4ff;
  color: var(--vip-strong);
}

.login-gps-card strong,
.login-gps-card span {
  display: block;
}

.login-gps-card span {
  color: #5e6a7d;
}

.login-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b7688;
  text-align: center;
}

.login-secure-note p {
  margin: 0;
}

.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(77, 140, 255, 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,
  .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;
  }

  .login-showcase {
    grid-template-columns: 1fr;
    padding: 0;
    background: #fff;
  }

  .login-photo-panel {
    display: none;
  }

  .login-auth-panel {
    min-height: 100vh;
    border-radius: 0;
    padding: 30px;
    box-shadow: none;
  }

  .login-auth-card {
    width: min(390px, 100%);
    gap: 28px;
  }

  .login-logo-frame {
    width: min(390px, 100%);
    height: 205px;
  }

  .login-logo {
    width: 520px;
  }
}

@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-logo-frame {
    width: 100%;
    height: 188px;
  }

  .login-logo {
    width: 440px;
  }

  .login-auth-panel {
    align-items: start;
    padding: 28px 18px;
  }

  .login-auth-card {
    gap: 24px;
  }

  .login-tabs .tab {
    padding: 13px 8px;
  }

  .login-form input,
  .login-form select {
    height: 54px;
  }

  .login-form .btn.primary {
    min-height: 56px;
  }

  .login-gps-card {
    padding: 14px;
  }

  .login-secure-note {
    font-size: 14px;
  }
}
