:root {
  --canvas: #e9eef5;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.78);
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-tint: rgba(37, 99, 235, 0.08);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --remote: #818cf8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.06), 0 16px 40px rgba(15, 23, 42, 0.13);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --font-ui: Inter, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --canvas: #05080f;
  --background: #0b1220;
  --surface: #121b2e;
  --surface-muted: rgba(18, 27, 46, 0.88);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #223049;
  --primary-tint: rgba(96, 165, 250, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.38), 0 18px 44px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--text);
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, var(--canvas) 0%, var(--background) 28%, var(--background) 100%);
  color: var(--text);
}

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

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

button {
  border: 0;
  cursor: pointer;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.page-shell.compact {
  padding: 0;
}

.container {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.login-grid {
  width: min(1160px, calc(100% - 24px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1fr 0.96fr;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.login-grid.simple-login {
  width: min(520px, calc(100% - 24px));
  grid-template-columns: 1fr;
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 760px;
  padding: 40px;
  color: #ffffff;
  background: linear-gradient(165deg, #2563eb 0%, #1e3a8a 100%);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 32%);
}

.hero-panel > * {
  position: relative;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.logo-mark img {
  width: 64px;
  height: 64px;
}

.hero-title {
  max-width: 560px;
  margin: 32px 0 0;
  font-size: clamp(40px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  padding: 20px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.hero-stat {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.1);
}

.hero-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
}

.hero-stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
}

.hero-caption {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.auth-panel {
  display: flex;
  align-items: center;
  min-height: 760px;
  padding: 40px;
  background: var(--background);
}

.auth-card {
  width: min(430px, 100%);
  margin: 0 auto;
}

.simple-login .auth-panel {
  min-height: calc(100vh - 48px);
  padding: 40px 32px;
}

.simple-login .auth-card {
  width: 100%;
}

.simple-login-note {
  margin-top: 16px;
}

.eyebrow {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.headline {
  margin: 12px 0 0;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.subcopy {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.info-callout {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: var(--primary-tint);
  color: var(--text-secondary);
}

.info-callout strong,
.text-strong {
  color: var(--text);
}

.credential-list {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus,
.button:focus-visible,
.nav-link:focus-visible,
.sidebar-link:focus-visible,
.theme-button:focus-visible,
.icon-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.helper-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.button-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.22);
}

.button-soft {
  background: var(--primary-tint);
  color: var(--primary);
}

.button-full {
  width: 100%;
}

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

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.24);
  color: #15803d;
}

.flash-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.24);
  color: #b45309;
}

.flash-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.24);
  color: var(--danger);
}

.flash-info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--primary);
}

.flash-close {
  color: inherit;
  opacity: 0.72;
}

.support-card,
.card {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card-lift {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.phone-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 128px;
}

.phone-frame {
  width: min(430px, 100%);
  min-height: 844px;
  position: relative;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.phone-content {
  min-height: 844px;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 176px;
}

.section-stack {
  display: grid;
  gap: 20px;
}

.mini-muted {
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-card {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(165deg, #2563eb 0%, #1e3a8a 100%);
  border: 0;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 36%);
}

.hero-card > * {
  position: relative;
}

.status-dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4ade80;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.hero-metric {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-metric-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-metric-value {
  margin-top: 8px;
  font-weight: 700;
}

.quick-grid,
.stat-grid,
.info-grid {
  display: grid;
  gap: 12px;
}

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

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

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

.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.quick-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
}

.metric-card {
  padding: 16px;
}

.metric-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.metric-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--background);
}

.list-row.compact {
  align-items: center;
}

.list-title {
  font-weight: 700;
}

.list-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-button,
.theme-button,
.nav-link,
.sidebar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.pill-button:hover,
.theme-button:hover,
.nav-link:hover,
.sidebar-link:hover {
  transform: translateY(-1px);
}

.pill-button.is-active,
.theme-button.is-active,
.nav-link.is-active,
.sidebar-link.is-active {
  background: var(--text);
  color: var(--background);
  border-color: var(--text);
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--background);
  color: var(--text);
}

.chip-present {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.chip-late {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.chip-absent {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.chip-remote {
  background: rgba(129, 140, 248, 0.16);
  color: #4f46e5;
}

.chip-leave {
  background: rgba(37, 99, 235, 0.14);
  color: var(--primary);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 32px));
  bottom: 0;
  z-index: 40;
  margin-top: 0;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .bottom-nav {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.88), rgba(11, 18, 32, 0.98) 100%);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.34);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.bottom-nav-link {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.bottom-nav-link strong {
  font-size: 13px;
}

.bottom-nav-link.is-active {
  color: var(--text);
}

.fab-link {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.fab-link.is-danger {
  background: var(--danger);
}

.dashboard-shell {
  min-height: 100vh;
  padding: 24px;
}

.dashboard-layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 24px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 24px 18px;
}

.sidebar-group {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sidebar-link {
  justify-content: flex-start;
  border-radius: 18px;
}

.sidebar-link.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.app-icon,
.nav-icon,
.button-icon,
.sidebar-icon,
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-icon svg,
.nav-icon svg,
.button-icon svg,
.sidebar-icon svg,
.status-icon svg,
.icon-button svg,
.quick-action-icon svg,
.fab-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon svg,
.nav-icon svg,
.sidebar-icon svg {
  width: 18px;
  height: 18px;
}

.icon-button {
  position: relative;
  color: var(--text);
}

.icon-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.quick-action-icon {
  font-weight: 700;
}

.permission-card {
  display: grid;
  gap: 16px;
}

.selfie-preview-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.selfie-preview-shell {
  min-height: 208px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(15, 23, 42, 0.02));
}

.selfie-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 208px;
  object-fit: cover;
}

.selfie-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-secondary);
  text-align: center;
}

.permission-list {
  display: grid;
  gap: 12px;
}

.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--background);
}

.permission-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.permission-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.permission-status.is-ready {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.permission-message {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.permission-message.is-error {
  color: var(--danger);
}

.permission-message.is-success {
  color: #15803d;
}

.clock-modal-open {
  overflow: hidden;
}

.clock-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: end center;
  padding: 20px;
}

.clock-modal[hidden],
.camera-stage[hidden],
.camera-feed[hidden],
.camera-captured[hidden],
.camera-placeholder[hidden],
.clock-modal-actions [hidden] {
  display: none !important;
}

.clock-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
}

.clock-modal-sheet {
  position: relative;
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 28px 28px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.28);
}

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

.clock-modal-actions .button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.camera-stage {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top, rgba(14, 165, 233, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.12));
}

.camera-feed,
.camera-captured {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: 360px;
  object-fit: cover;
  background: #0f172a;
}

.camera-canvas {
  display: none;
}

.camera-placeholder {
  min-height: 260px;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-secondary);
  text-align: center;
}

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

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

.inline-icon-text,
.sidebar-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.inline-icon-text {
  font-weight: 700;
}

.bottom-nav-link {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.bottom-nav-label {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.bottom-nav-label strong {
  font-size: 13px;
}

.fab-link {
  gap: 6px;
  flex-direction: column;
  font-size: 11px;
}

.fab-link svg {
  width: 24px;
  height: 24px;
}

.sidebar-link {
  justify-content: flex-start;
  border-radius: 18px;
  width: 100%;
}

.sidebar-link-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--background);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-link.is-active .sidebar-count {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.topbar-actions .button {
  min-height: 46px;
}

.logout-link {
  min-width: 120px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #ffffff;
  font-weight: 800;
}

.avatar-md {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.avatar-lg {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  font-size: 28px;
}

.dashboard-main {
  display: grid;
  gap: 24px;
}

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

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

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

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

.dashboard-grid.split {
  grid-template-columns: 1.3fr 0.7fr;
}

.dashboard-grid.split-alt {
  grid-template-columns: 1.1fr 0.9fr;
}

.stat-card {
  padding: 22px;
}

.stat-card-value {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card-note {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding-bottom: 12px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
}

.table td {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-inline > * {
  flex: 1 1 180px;
}

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

.role-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.role-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-form-row .select {
  flex: 1 1 auto;
}

.bars {
  display: flex;
  align-items: end;
  gap: 14px;
  min-height: 220px;
  margin-top: 22px;
}

.bar-column {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.bar-stack {
  width: 100%;
  display: flex;
  align-items: end;
  gap: 8px;
}

.bar-primary,
.bar-secondary {
  border-radius: 18px 18px 0 0;
}

.bar-primary {
  flex: 1;
  background: var(--primary);
}

.bar-secondary {
  width: 14px;
  background: var(--warning);
}

.donut {
  width: 176px;
  height: 176px;
  border-radius: 999px;
  position: relative;
  background: conic-gradient(var(--success) 0 58%, var(--remote) 58% 70%, var(--warning) 70% 82%, var(--primary) 82% 92%, var(--danger) 92% 100%);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: inherit;
  background: var(--surface);
}

.legend-stack {
  display: grid;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--primary);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.heat-cell {
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.muted-panel {
  padding: 16px;
  border-radius: 18px;
  background: var(--background);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: var(--background);
  color: var(--text-secondary);
}

.theme-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--background);
}

.theme-button {
  border: 0;
  min-width: 88px;
  background: transparent;
}

.theme-button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.link-inline {
  color: var(--primary);
  font-weight: 700;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.center {
  text-align: center;
}

.hidden-desktop {
  display: none;
}

.hidden-mobile {
  display: inline-flex;
}

@media (max-width: 1100px) {
  .login-grid,
  .dashboard-layout,
  .dashboard-grid.split,
  .dashboard-grid.split-alt,
  .dashboard-grid.four,
  .dashboard-grid.three,
  .dashboard-grid.two {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 820px) {
  .page-shell,
  .dashboard-shell {
    padding: 16px;
  }

  .login-grid {
    margin: 12px auto;
    min-height: 0;
  }

  .hero-panel {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    padding: 28px 22px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-inline {
    flex-direction: column;
  }

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

  .role-form-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .phone-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .phone-content {
    min-height: 100vh;
    padding-bottom: 188px;
  }

  .bottom-nav {
    width: 100%;
    left: 0;
    right: 0;
    transform: none;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }

  .clock-modal {
    padding: 0;
  }

  .clock-modal-sheet {
    width: 100%;
    border-radius: 28px 28px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }

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

  .quick-grid,
  .stat-grid,
  .info-grid.two,
  .hero-metrics,
  .hero-stats,
  .button-grid {
    grid-template-columns: 1fr;
  }

  .hidden-mobile {
    display: none;
  }

  .hidden-desktop {
    display: inline-flex;
  }

  .header-actions {
    gap: 8px;
  }

  .logout-link {
    min-width: 46px;
    width: 46px;
    padding: 0;
  }

  .logout-link .button-label {
    display: none;
  }
}

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