:root {
  --bg: #030712;
  --panel: rgba(7, 18, 39, 0.86);
  --panel-strong: rgba(10, 31, 68, 0.94);
  --line: rgba(89, 199, 255, 0.24);
  --line-strong: rgba(87, 204, 255, 0.52);
  --text: #edf8ff;
  --muted: #8ba8bd;
  --blue: #26b7ff;
  --cyan: #4efff0;
  --violet: #6675ff;
  --danger: #ff477e;
  --warning: #ffd166;
  --good: #32f6a6;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(38, 183, 255, 0.22), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(102, 117, 255, 0.2), transparent 32%),
    linear-gradient(135deg, #02040b 0%, #06162d 46%, #02040b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(78, 255, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 255, 240, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 85%);
}

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

.app-shell {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  padding: 18px 0 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow: 0 0 32px rgba(38, 183, 255, 0.26);
}

h2 {
  font-size: 21px;
  line-height: 1.15;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin-top: 14px;
}

.developer-credit {
  color: #dff8ff;
  font-size: 13px;
  font-weight: 900;
  margin-top: 10px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.74);
  padding: 6px;
  min-width: 270px;
  box-shadow: inset 0 0 26px rgba(38, 183, 255, 0.08);
}

.mode-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  font-weight: 900;
  cursor: pointer;
}

.mode-btn.active {
  color: #001522;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 24px rgba(38, 183, 255, 0.4);
}

.notice {
  border: 1px solid rgba(78, 255, 240, 0.26);
  border-left: 5px solid var(--cyan);
  border-radius: 8px;
  background: rgba(4, 19, 40, 0.72);
  padding: 14px 16px;
  margin-bottom: 18px;
  color: #ccefff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.workspace.hidden {
  display: none;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 0 36px rgba(38, 183, 255, 0.06);
  padding: 20px;
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(78, 255, 240, 0.1), transparent 32%, rgba(102, 117, 255, 0.1));
  opacity: 0.75;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.punch-panel,
.command-panel {
  background: var(--panel-strong);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.neutral {
  background: rgba(139, 168, 189, 0.13);
  color: #c4d5e3;
}

.badge.good {
  background: rgba(50, 246, 166, 0.13);
  color: var(--good);
  border-color: rgba(50, 246, 166, 0.36);
}

.badge.warn {
  background: rgba(255, 209, 102, 0.13);
  color: var(--warning);
  border-color: rgba(255, 209, 102, 0.36);
}

.badge.danger {
  background: rgba(255, 71, 126, 0.13);
  color: var(--danger);
  border-color: rgba(255, 71, 126, 0.36);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.78);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #5f7890;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(78, 255, 240, 0.13), 0 0 22px rgba(38, 183, 255, 0.16);
}

.signup-strip,
.employee-form,
.manual-form,
.rules,
.form-grid,
.login-form {
  display: grid;
  gap: 12px;
}

.session-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(38, 183, 255, 0.08);
  margin-bottom: 14px;
}

.session-strip span {
  color: #dff8ff;
  font-weight: 900;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.signup-strip {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(38, 183, 255, 0.06);
}

.clock-card {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(38, 183, 255, 0.16), rgba(78, 255, 240, 0.08));
  border: 1px solid var(--line-strong);
}

.clock-card span,
.clock-card small {
  color: #a9c4d8;
  font-weight: 800;
}

.clock-card strong {
  font-size: clamp(40px, 8vw, 70px);
  line-height: 1;
  color: #f5fdff;
  text-shadow: 0 0 28px rgba(78, 255, 240, 0.34);
}

.permission-box {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.09);
  color: #ffe7a6;
}

.permission-box span {
  color: #d9c486;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.permission-box.hidden {
  display: none;
}

.selfie-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.5);
}

.selfie-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selfie-head strong {
  display: block;
  color: #dff8ff;
}

.camera-video,
.selfie-preview {
  width: min(280px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #020814;
  box-shadow: 0 0 34px rgba(78, 255, 240, 0.22);
}

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

.selfie-cell {
  display: flex;
  gap: 8px;
}

.selfie-cell img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-grid,
.mini-grid,
.metrics {
  display: grid;
  gap: 12px;
}

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

.mini-grid,
.metrics {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
}

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

.mini-grid div,
.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(2, 8, 20, 0.58);
}

.mini-grid span,
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.mini-grid strong,
.metrics strong {
  font-size: 24px;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 950;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid rgba(78, 255, 240, 0.65);
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #001522;
  box-shadow: 0 0 24px rgba(38, 183, 255, 0.28);
}

.secondary-btn {
  border: 1px solid var(--line-strong);
  background: rgba(38, 183, 255, 0.11);
  color: #dff8ff;
}

.danger-btn {
  border: 1px solid rgba(255, 71, 126, 0.4);
  background: rgba(255, 71, 126, 0.12);
  color: #ff9fbd;
}

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

.wide {
  grid-column: 1 / -1;
}

.rules {
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
}

.employee-form {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
}

.manual-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.employee-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px 110px 140px 140px 120px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.48);
}

.employee-row strong,
.employee-row small {
  display: block;
}

.employee-row small {
  color: var(--muted);
  margin-top: 3px;
}

.table-panel {
  grid-column: 1 / -1;
}

.payroll-actions {
  display: grid;
  grid-template-columns: 180px auto auto;
  gap: 10px;
}

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

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

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

th {
  color: #91b8d5;
  font-size: 12px;
  text-transform: uppercase;
}

td small {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  max-width: min(520px, calc(100% - 32px));
  background: #dff8ff;
  color: #001522;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 900;
  transition: 180ms ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 20, 0.82);
  backdrop-filter: blur(16px);
}

.lock-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow), 0 0 42px rgba(38, 183, 255, 0.18);
}

.lock-card small {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 980px) {
  .hero,
  .panel-head {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .workspace,
  .form-grid,
  .rules,
  .metrics,
  .employee-form,
  .manual-form,
  .employee-row,
  .payroll-actions {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 12px;
  }

  .mode-switch,
  .action-grid,
  .mini-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}
