:root {
  --ink: #12241f;
  --ink-soft: #344a43;
  --muted: #70817a;
  --paper: #f4f0e8;
  --paper-deep: #e9e3d7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #fbfaf6;
  --line: rgba(18, 36, 31, 0.1);
  --deep: #102c26;
  --deep-2: #173d34;
  --orange: #f67a36;
  --orange-soft: #ffe4d1;
  --teal: #16a58c;
  --teal-soft: #dff8f2;
  --blue: #3568dc;
  --blue-soft: #e5edff;
  --yellow: #f4c64e;
  --danger: #cf4e48;
  --success: #168b6e;
  --shadow: 0 24px 80px rgba(33, 48, 42, 0.12);
  --radius: 24px;
  --radius-sm: 15px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(246, 122, 54, 0.06), transparent 30%),
    linear-gradient(315deg, rgba(22, 165, 140, 0.08), transparent 35%),
    var(--paper);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-one {
  width: 420px;
  height: 420px;
  right: -180px;
  top: -150px;
  background: radial-gradient(circle, rgba(246, 122, 54, 0.18), transparent 68%);
}

.ambient-two {
  width: 540px;
  height: 540px;
  left: -280px;
  bottom: -260px;
  background: radial-gradient(circle, rgba(22, 165, 140, 0.15), transparent 68%);
}

.is-hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 9px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.eyebrow.dark {
  color: var(--orange);
}

.eyebrow.light {
  color: rgba(255, 255, 255, 0.58);
}

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

.tiny {
  font-size: 12px;
}

.login-screen {
  width: min(1240px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 58px 0;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 76px;
  align-items: center;
}

.login-brand {
  padding: 34px 8px;
}

.brand-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin-bottom: 26px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(122, 20, 28, 0.12));
}

.login-brand .eyebrow {
  color: var(--orange);
}

.login-brand h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.16;
  letter-spacing: -0.055em;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-brand h1 em {
  color: var(--orange);
  font-style: normal;
  position: relative;
  text-decoration: underline dashed var(--yellow);
  text-decoration-thickness: 6px;
  text-underline-offset: 6px;
}

.login-brand h1 em::after { content: none; }

.login-copy {
  max-width: 600px;
  margin: 30px 0 25px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}

.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.login-features span {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-soft);
  font-size: 13px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card-head,
.panel-head,
.page-heading,
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.login-card-head h2,
.panel-head h2,
.section-row h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot i,
.connectivity i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 139, 110, 0.12);
}

.demo-accounts {
  display: grid;
  gap: 9px;
  margin: 25px 0 22px;
}

.demo-account {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.55);
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.demo-account:hover,
.demo-account.active {
  border-color: rgba(246, 122, 54, 0.38);
  background: #fff9f3;
  transform: translateY(-1px);
}

.demo-account > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-account b {
  font-size: 14px;
}

.demo-account small {
  color: var(--muted);
  font-size: 12px;
}

.avatar,
.header-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 800;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.avatar img {
  width: 23px;
  height: 23px;
  display: block;
}

.tone-orange { background: linear-gradient(145deg, #ff9255, #e65e20); }
.tone-teal { background: linear-gradient(145deg, #2dc5aa, #11836f); }
.tone-blue { background: linear-gradient(145deg, #6790ef, #2f5bc5); }

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

.login-form label,
.form-field {
  display: grid;
  gap: 7px;
}

.login-form label > span,
.form-field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(18, 36, 31, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(246, 122, 54, 0.68);
  box-shadow: 0 0 0 4px rgba(246, 122, 54, 0.1);
}

.button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #e65d1c);
  box-shadow: 0 12px 28px rgba(230, 93, 28, 0.24);
}

.button.secondary {
  color: var(--ink);
  background: #eee9df;
}

.button.ghost-light {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.button.wide {
  width: 100%;
}

.login-meta,
.privacy-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.login-meta a {
  color: var(--blue);
  font-weight: 700;
}

.login-meta code {
  color: var(--ink);
}

.privacy-note {
  display: block;
  margin: 0;
  padding: 0 12px;
  text-align: center;
  line-height: 1.6;
}

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 112px;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 0 28px;
  background: linear-gradient(to bottom, rgba(244, 240, 232, 0.98), rgba(244, 240, 232, 0.84), transparent);
  backdrop-filter: blur(14px);
}

.app-header-inner {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.brand-button > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand-button b {
  font-size: 17px;
}

.brand-button small {
  color: var(--muted);
  font-size: 10px;
}

.mini-mark {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.connectivity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 11px;
}

.connectivity.offline i {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(246, 122, 54, 0.13);
}

.header-avatar {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  background: var(--deep);
  cursor: pointer;
}

.app-main {
  padding: 10px 28px 0;
}

.page {
  display: none;
  animation: page-in 250ms ease both;
}

.page.active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-heading {
  align-items: flex-end;
  padding: 16px 0 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(29px, 4vw, 42px);
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-heading p:last-child {
  margin: 10px 0 0;
}

.role-badge,
.hard-rule {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.role-badge {
  color: var(--deep);
  background: var(--teal-soft);
}

.role-badge.warm {
  color: #8b3e15;
  background: var(--orange-soft);
}

.hard-rule {
  color: #7a4d00;
  background: #fff0b9;
  border: 1px solid rgba(122, 77, 0, 0.1);
}

.home-grid,
.attendance-layout,
.profile-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.home-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.project-card {
  min-height: 280px;
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 200, 115, 0.2), transparent 26%),
    linear-gradient(145deg, #11362d, #0c211d 75%);
  box-shadow: 0 22px 60px rgba(16, 44, 38, 0.2);
}

.project-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  bottom: -80px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025), 0 0 0 74px rgba(255, 255, 255, 0.02);
}

.project-card::after {
  content: "";
  position: absolute;
  height: 9px;
  left: 30px;
  right: 30px;
  bottom: 24px;
  border-radius: 30px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 18px, transparent 18px 27px);
  opacity: 0.8;
}

.project-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-top h2 {
  max-width: 430px;
  margin: 5px 0 8px;
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.project-code {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10px;
  white-space: nowrap;
}

.project-location {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 12px 0 26px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.project-status-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.project-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #59e7bb;
}

.project-status-row .button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 12px;
}

.skeleton-card {
  background: linear-gradient(110deg, #14382f 30%, #1b4439 45%, #14382f 60%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { background-position-x: -200%; }
}

.panel,
.metrics-panel {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(33, 48, 42, 0.06);
  backdrop-filter: blur(16px);
}

.metrics-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 20px;
}

.metric-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.58);
}

.metric-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 26px;
  letter-spacing: -0.05em;
}

.metric-card span {
  color: var(--muted);
  font-size: 11px;
}

.section-row {
  margin: 34px 2px 14px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.quick-action {
  min-height: 122px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(33, 48, 42, 0.09);
}

.quick-action .action-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 17px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--orange-soft);
  color: #b44c16;
  font-size: 18px;
  font-weight: 800;
}

.quick-action:nth-child(2) .action-icon { color: #0d7563; background: var(--teal-soft); }
.quick-action:nth-child(3) .action-icon { color: var(--blue); background: var(--blue-soft); }
.quick-action:nth-child(4) .action-icon { color: #765600; background: #fff1bd; }

.quick-action b {
  display: block;
  font-size: 14px;
}

.quick-action small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.content-grid {
  grid-template-columns: 1.08fr 0.92fr;
  margin-top: 18px;
}

.content-grid.equal {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.text-button {
  padding: 7px 0;
  border: 0;
  background: none;
  color: var(--orange);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-button.compact {
  margin-top: 10px;
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 17px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 15px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 50px;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 32px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}

.timeline-dot {
  width: 13px;
  height: 13px;
  border: 3px solid #d9f5ed;
  border-radius: 50%;
  background: var(--teal);
}

.timeline-item:first-child .timeline-dot {
  border-color: var(--orange-soft);
  background: var(--orange);
}

.timeline-main b {
  display: block;
  font-size: 13px;
}

.timeline-main small,
.timeline-time {
  color: var(--muted);
  font-size: 11px;
}

.timeline-time {
  font-variant-numeric: tabular-nums;
}

.empty-state {
  min-height: 124px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.insight-panel {
  display: flex;
  gap: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgba(246, 199, 78, 0.18), transparent 28%),
    var(--deep);
}

.insight-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--deep);
  background: #dff9cd;
  font-weight: 900;
}

.insight-panel h2 {
  margin: 5px 0 10px;
  font-size: 20px;
}

.insight-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  line-height: 1.7;
}

.insight-tag {
  display: inline-block;
  margin-top: 13px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #fff0b3;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(570px, calc(100% - 30px));
  height: 70px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(250, 248, 243, 0.88);
  box-shadow: 0 18px 50px rgba(16, 44, 38, 0.18);
  backdrop-filter: blur(22px);
  transform: translateX(-50%);
}

.bottom-nav button {
  border: 0;
  border-radius: 17px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  cursor: pointer;
}

.bottom-nav button span {
  font-size: 18px;
  font-weight: 700;
}

.bottom-nav button small {
  font-size: 10px;
}

.bottom-nav button.active {
  color: #fff;
  background: var(--deep);
  box-shadow: 0 8px 20px rgba(16, 44, 38, 0.18);
}

.attendance-layout {
  grid-template-columns: 1fr 0.93fr;
}

.clock-card {
  min-height: 390px;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: 34px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 15% 80%, rgba(36, 210, 178, 0.2), transparent 32%),
    linear-gradient(145deg, #0d2c25, #173f35);
  box-shadow: 0 22px 60px rgba(16, 44, 38, 0.18);
}

.radar-wrap {
  display: grid;
  place-items: center;
}

.radar {
  width: 220px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle, rgba(22, 165, 140, 0.14), transparent 68%);
  background-size: 22px 22px, 22px 22px, auto;
}

.radar::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 50%;
  left: 50%;
  top: 0;
  transform-origin: left bottom;
  background: conic-gradient(from 180deg, rgba(68, 234, 199, 0.32), transparent 70deg);
  animation: sweep 4s linear infinite;
}

@keyframes sweep {
  to { transform: rotate(360deg); }
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.ring-one { inset: 18%; }
.ring-two { inset: 36%; }
.ring-three { inset: 52%; border-color: rgba(255, 255, 255, 0.28); }

.radar-pin {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50% 50% 50% 8px;
  color: var(--deep);
  background: var(--orange);
  box-shadow: 0 0 0 9px rgba(246, 122, 54, 0.16);
  transform: rotate(-45deg);
  font-size: 25px;
}

.radar-pin::first-letter {
  transform: rotate(45deg);
}

.clock-copy h2 {
  margin: 8px 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.clock-copy > p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 12px;
  line-height: 1.7;
}

.distance-readout {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 24px 0 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.distance-readout strong {
  color: #fff;
  font-size: 40px;
  letter-spacing: -0.05em;
}

.distance-readout em {
  margin-left: auto;
  color: #b6d8ce;
  font-size: 10px;
  font-style: normal;
}

.evidence-panel {
  display: flex;
  flex-direction: column;
}

.evidence-drop {
  min-height: 175px;
  margin-top: 16px;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(18, 36, 31, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, #fbf9f4, #f1ede4);
  cursor: pointer;
}

.evidence-drop input {
  display: none;
}

.evidence-placeholder {
  display: grid;
  place-items: center;
  gap: 5px;
  color: var(--muted);
}

.evidence-placeholder b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b64c14;
  background: var(--orange-soft);
  font-size: 20px;
}

.evidence-placeholder strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.evidence-placeholder small {
  font-size: 10px;
}

#evidencePreview {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#evidencePreview.visible {
  display: block;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 17px 0;
  cursor: pointer;
}

.switch-row > span {
  flex: 1;
}

.switch-row b,
.switch-row small {
  display: block;
}

.switch-row b {
  font-size: 13px;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.switch-row input {
  display: none;
}

.switch-row i {
  width: 42px;
  height: 24px;
  position: relative;
  border-radius: 999px;
  background: #d8d4cc;
  transition: 180ms ease;
}

.switch-row i::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
  transition: 180ms ease;
}

.switch-row input:checked + i {
  background: var(--teal);
}

.switch-row input:checked + i::after {
  left: 21px;
}

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

.inline-feedback {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.inline-feedback.success { color: var(--success); }
.inline-feedback.error { color: var(--danger); }

.offline-queue {
  margin-top: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff3db;
  color: #815c14;
  font-size: 10px;
}

.record-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.record-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.52);
}

.record-main {
  min-width: 0;
  flex: 1;
}

.record-main b {
  display: block;
  font-size: 13px;
}

.record-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.work-order-media {
  margin: 12px 0;
}

.work-order-scope {
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid rgba(24, 85, 70, 0.13);
  border-radius: 12px;
  background: #f2f7f4;
}

.work-order-scope small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.work-order-scope p {
  margin: 0;
  color: #183b32;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.work-order-media > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.work-order-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.work-order-photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  object-fit: cover;
  background: #e8e5de;
}

.record-side {
  flex: 0 0 auto;
  text-align: right;
}

.record-side strong {
  display: block;
  font-size: 15px;
}

.record-side small,
.record-time {
  color: var(--muted);
  font-size: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.status-pending { color: #8b5b0a; background: #fff2c7; }
.status-approved, .status-signed, .status-paid { color: #0b705c; background: #dcf6ee; }
.status-rejected { color: #a23f3b; background: #ffe3e0; }

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

.work-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  min-height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.72);
}

.work-card::after {
  content: attr(data-index);
  position: absolute;
  right: 17px;
  top: 3px;
  color: rgba(18, 36, 31, 0.045);
  font-size: 82px;
  font-weight: 900;
}

.work-card h3 {
  position: relative;
  margin: 0 0 7px;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.work-card p {
  position: relative;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.work-card .button {
  position: relative;
  min-height: 40px;
  padding: 0 15px;
  font-size: 12px;
}

#managerReviewPanel {
  margin-top: 18px;
}

.review-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.mini-button {
  min-height: 29px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.mini-button.approve { color: #fff; background: var(--success); }
.mini-button.reject { color: #a33d39; background: #ffe7e4; }

.segmented {
  width: fit-content;
  margin-bottom: 14px;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.segmented button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.segmented button.active {
  color: #fff;
  background: var(--deep);
}

.ledger-panel {
  min-height: 300px;
}

.ledger-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 20px;
  border-radius: 18px;
  color: #fff;
  background: var(--deep);
}

.ledger-hero strong {
  display: block;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.ledger-hero small {
  color: rgba(255, 255, 255, 0.55);
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.ledger-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-picker span {
  color: var(--muted);
  font-size: 11px;
}

.month-picker input,
.month-picker select {
  width: 135px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.month-picker select {
  max-width: 220px;
}

.profile-grid {
  grid-template-columns: 0.72fr 1.28fr;
}

.profile-card {
  grid-row: span 2;
  padding: 32px 25px;
  border-radius: 25px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(246, 122, 54, 0.2), transparent 38%),
    var(--deep);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  margin: 10px auto 18px;
  border-radius: 28px;
  color: var(--deep);
  background: var(--orange);
  font-size: 32px;
}

.profile-card h2 {
  margin: 0;
  font-size: 26px;
}

.profile-card > p {
  margin: 7px 0 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.verified-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 35px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #c9f7e8;
  background: rgba(22, 165, 140, 0.14);
  font-size: 10px;
}

.verified-row span {
  color: #67e4c4;
}

.profile-card .button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  margin-top: 10px;
}

.detail-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.detail-row b {
  font-size: 13px;
  word-break: break-all;
}

.consent-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.consent-list > div {
  display: flex;
  gap: 11px;
}

.consent-list > div > span {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--success);
  background: var(--teal-soft);
  font-size: 11px;
}

.consent-list p {
  margin: 0;
}

.consent-list b,
.consent-list small {
  display: block;
}

.consent-list b {
  font-size: 12px;
}

.consent-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 105px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: rgba(16, 44, 38, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 200ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #9f3e3a;
}

.action-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.action-dialog::backdrop {
  background: rgba(8, 24, 20, 0.54);
  backdrop-filter: blur(5px);
}

.dialog-card {
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 27px;
  border-radius: 24px;
  background: var(--surface-solid);
}

.dialog-close {
  position: absolute;
  right: 17px;
  top: 15px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #eee9df;
  cursor: pointer;
}

.dialog-card h2 {
  margin: 4px 45px 7px 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.dialog-description {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.dialog-form .button {
  margin-top: 4px;
}

.signature-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f2eee6;
}

.signature-box p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.checkbox-row input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 1px 0 0;
}

@media (max-width: 900px) {
  .login-screen {
    width: min(620px, calc(100% - 30px));
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 0;
  }

  .login-brand {
    padding: 10px 0 0;
  }

  .brand-logo {
    width: 88px;
    height: 88px;
    margin-bottom: 20px;
  }

  .login-brand h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .login-copy {
    margin: 23px 0 16px;
    font-size: 14px;
  }

  .home-grid,
  .attendance-layout,
  .content-grid,
  .content-grid.equal,
  .profile-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-card {
    grid-row: auto;
  }
}

@media (max-width: 620px) {
  .app-header {
    padding: 0 16px;
  }

  .app-header-inner {
    height: 70px;
  }

  .app-main {
    padding: 4px 14px 0;
  }

  .connectivity {
    display: none;
  }

  .page-heading {
    align-items: flex-start;
    padding: 12px 2px 18px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  .role-badge,
  .hard-rule {
    min-height: 29px;
    margin-top: 3px;
    padding: 0 10px;
    font-size: 10px;
  }

  .project-card {
    min-height: 265px;
    padding: 24px;
  }

  .project-card::after {
    left: 24px;
    right: 24px;
  }

  .project-top h2 {
    font-size: 29px;
  }

  .project-code {
    display: none;
  }

  .panel,
  .metrics-panel {
    padding: 19px;
    border-radius: 21px;
  }

  .quick-actions {
    gap: 9px;
  }

  .quick-action {
    min-height: 111px;
    padding: 16px;
  }

  .quick-action .action-icon {
    margin-bottom: 13px;
  }

  .content-grid {
    margin-top: 12px;
  }

  .clock-card {
    grid-template-columns: 1fr;
    padding: 26px 21px;
  }

  .radar {
    width: 170px;
  }

  .clock-copy {
    text-align: center;
  }

  .clock-copy > p:not(.eyebrow) {
    max-width: 310px;
    margin: 0 auto;
  }

  .distance-readout {
    justify-content: center;
  }

  .distance-readout em {
    margin-left: 6px;
  }

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

  .action-cards .work-card {
    min-height: 170px;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button {
    flex: 1 0 auto;
    padding: 0 12px;
  }

  .month-picker span {
    display: none;
  }

  .month-picker input {
    width: 119px;
  }

  .ledger-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .month-picker select {
    width: 180px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

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

  .bottom-nav {
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 64px;
    border-radius: 21px;
  }

  .bottom-nav button {
    border-radius: 15px;
  }

  .bottom-nav button span {
    font-size: 16px;
  }
}

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