@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

:root {
  --app-height: 100vh;
  --text: #14202b;
  --muted: #62707d;
  --border: #d6dee5;
  --panel: #ffffff;
  --panel-2: #f4f7fa;
  --accent: #87b51f;
  --accent-2: #6e9519;
  --accent-soft: #eef4df;
  --danger: #b42318;
  --danger-soft: #fdecec;
  --success: #245a36;
  --success-soft: #eaf8ee;
  --warning: #7a5c00;
  --warning-soft: #fff6d7;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.05);
  --header-bg: rgba(249, 251, 252, 0.78);
  --transition-fast: 0.18s ease;
  --transition-base: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--app-height);
  color: var(--text);
  background:
    radial-gradient(960px 560px at 100% -8%, rgba(167, 218, 43, 0.14) 0%, rgba(167, 218, 43, 0) 48%),
    radial-gradient(720px 360px at 0% 0%, rgba(20, 32, 43, 0.035) 0%, rgba(20, 32, 43, 0) 54%),
    linear-gradient(180deg, #f8fafb 0%, #edf2f5 100%);
  font-family: "Montserrat", "Trebuchet MS", sans-serif;
  -webkit-tap-highlight-color: rgba(135, 181, 31, 0.16);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(20, 32, 43, 0.025) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: -1;
}

.admin-shell {
  background:
    radial-gradient(1200px 620px at 100% -10%, rgba(167, 218, 43, 0.16) 0%, rgba(167, 218, 43, 0) 45%),
    linear-gradient(180deg, #f6f9fb 0%, #ecf1f4 100%);
}

a {
  color: #22313f;
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-base);
}

a:hover {
  color: #6b9b0d;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 24px 36px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(20, 32, 43, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
  transition: transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  will-change: transform;
}

.site-header-inner {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

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

.brand-logo {
  display: block;
  width: 120px;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 12px 22px rgba(20, 32, 43, 0.08));
  transition: transform var(--transition-base), filter var(--transition-base);
}

.brand-link:hover .brand-logo {
  transform: translateY(-1px) scale(1.015);
  filter: drop-shadow(0 16px 28px rgba(20, 32, 43, 0.12));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #17202a;
  line-height: 1;
}

.brand-subtitle {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.35px;
  color: #73808d;
  font-weight: 600;
  line-height: 1.25;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.site-nav.has-horizontal-overflow::after,
.table-wrap.has-horizontal-overflow::after,
.quick-action-grid.has-horizontal-overflow::after {
  display: none;
}

.swipe-hint-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 72px;
  min-height: 34px;
  margin: 8px 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(23, 32, 42, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, #22313f 0%, #17202a 100%);
  color: #f8fafc;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  flex: 0 0 auto;
}

.swipe-hint-button[hidden] {
  display: none;
}

.site-nav + .swipe-hint-button {
  align-self: flex-end;
  margin-top: 2px;
}

.site-nav a,
.profile-pill {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.site-nav a {
  color: #3b4a59;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(20, 32, 43, 0.06);
  transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), color var(--transition-base);
  white-space: nowrap;
}

.site-nav a.is-current {
  background: linear-gradient(180deg, #87b51f 0%, #6e9519 100%);
  color: #f8fbfd;
  border-color: rgba(110, 149, 25, 0.3);
  box-shadow: 0 12px 24px rgba(110, 149, 25, 0.2);
}

.site-nav a:hover {
  color: #1e2b38;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #314050;
  background: linear-gradient(180deg, #2b3948 0%, #1a2430 100%);
  color: #f8fafc;
  text-transform: none;
  letter-spacing: 0.1px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.18);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.profile-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.2);
}

.profile-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #98c62e;
  box-shadow: 0 0 0 3px rgba(152, 198, 46, 0.16);
}

.profile-pill small {
  color: #c8d4df;
  font-size: 11px;
  font-weight: 600;
}

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

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,249,251,0.98));
  border: 1px solid rgba(24, 33, 43, 0.08);
  border-top: 3px solid rgba(135, 181, 31, 0.8);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-slow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  background: linear-gradient(180deg, rgba(135, 181, 31, 0.08), rgba(135, 181, 31, 0));
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0) 78%);
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 65px rgba(15, 23, 42, 0.1);
  border-color: rgba(135, 181, 31, 0.2);
}

.card:hover::before {
  opacity: 1;
  transform: scaleY(1.06);
}

.card:hover::after {
  opacity: 1;
  transform: translateX(130%);
  transition: transform 0.9s ease, opacity var(--transition-base);
}

.admin-shell .container {
  max-width: 1280px;
  padding-top: 28px;
}

.admin-shell .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,248,250,0.98));
  border-color: rgba(24, 33, 43, 0.09);
}

.welcome-hero,
.login-card,
.admin-shell-bar,
.metric-card,
.quick-action-card,
.admin-shell .card {
  animation: content-rise 0.42s var(--transition-slow) both;
}

.welcome-hero {
  animation-delay: 0.02s;
}

.login-card,
.admin-shell-bar {
  animation-delay: 0.05s;
}

.metric-card:nth-child(1),
.quick-action-card:nth-child(1),
.admin-shell .grid > .col-12:nth-child(1) .card,
.admin-shell .grid > .col-8:nth-child(1) .card,
.admin-shell .grid > .col-6:nth-child(1) .card,
.admin-shell .grid > .col-4:nth-child(1) .card {
  animation-delay: 0.08s;
}

.metric-card:nth-child(2),
.quick-action-card:nth-child(2),
.admin-shell .grid > .col-12:nth-child(2) .card,
.admin-shell .grid > .col-8:nth-child(2) .card,
.admin-shell .grid > .col-6:nth-child(2) .card,
.admin-shell .grid > .col-4:nth-child(2) .card {
  animation-delay: 0.12s;
}

.metric-card:nth-child(3),
.quick-action-card:nth-child(3),
.admin-shell .grid > .col-12:nth-child(3) .card,
.admin-shell .grid > .col-8:nth-child(3) .card,
.admin-shell .grid > .col-6:nth-child(3) .card,
.admin-shell .grid > .col-4:nth-child(3) .card {
  animation-delay: 0.16s;
}

.quick-action-card:nth-child(4),
.admin-shell .grid > .col-12:nth-child(4) .card,
.admin-shell .grid > .col-8:nth-child(4) .card,
.admin-shell .grid > .col-6:nth-child(4) .card,
.admin-shell .grid > .col-4:nth-child(4) .card {
  animation-delay: 0.2s;
}

h1, h2, h3 {
  margin: 0 0 12px;
  color: #17202a;
  font-family: "Montserrat", "Arial Black", sans-serif;
  letter-spacing: 0.5px;
}

h1 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

h1::after,
h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.admin-shell-bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 0 0 20px;
  padding: 24px 26px;
  border: 1px solid #d6dee4;
  border-radius: 22px;
  background:
    radial-gradient(460px 220px at 100% 0%, rgba(135, 181, 31, 0.2), rgba(135, 181, 31, 0)),
    linear-gradient(135deg, #ffffff 0%, #f5f8fa 100%);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.admin-shell-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 46px rgba(15, 23, 42, 0.08);
}

.admin-shell-eyebrow,
.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  font-weight: 800;
  color: #55606b;
}

.admin-shell-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.02;
}

.admin-shell-title::after {
  display: none;
}

.admin-shell-lead,
.lead {
  margin: 12px 0 0;
  max-width: 58ch;
  color: #5a6773;
  line-height: 1.7;
}

.admin-shell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-section-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 20px;
}

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

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid #dbe3e8;
  background:
    radial-gradient(160px 100px at 100% 0%, rgba(135, 181, 31, 0.1), rgba(135, 181, 31, 0)),
    linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.06);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-slow);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(135, 181, 31, 0.25);
  box-shadow: 0 22px 36px rgba(16, 24, 40, 0.1);
}

.metric-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5b6772;
}

.metric-value {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1;
  color: #18212b;
}

.metric-link {
  font-size: 13px;
  font-weight: 700;
  color: #365c19;
}

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

.quick-action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #dde4dc;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7f3 100%);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-slow);
}

.quick-action-card:hover {
  transform: translateY(-4px);
  border-color: #cddca8;
  box-shadow: 0 22px 36px rgba(17, 24, 39, 0.1);
  background: linear-gradient(180deg, #ffffff 0%, #f1f6e7 100%);
}

.quick-action-card strong {
  font-size: 15px;
  color: #18212b;
}

.quick-action-card span {
  color: #5c6670;
  line-height: 1.5;
}

.install-app-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(360px 180px at 100% 0%, rgba(135, 181, 31, 0.14), rgba(135, 181, 31, 0)),
    linear-gradient(135deg, #ffffff 0%, #f4f8ec 100%);
}

.install-app-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: 360px;
  text-align: right;
}

.install-app-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.install-nudge {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(20, 32, 43, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  animation: content-rise 0.32s var(--transition-slow) both;
}

.install-nudge.is-expanded {
  max-width: 760px;
}

.install-nudge-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  line-height: 1.45;
}

.install-nudge-copy strong {
  color: #17202a;
  font-size: 14px;
}

.install-nudge-copy span {
  color: var(--muted);
  font-size: 13px;
}

.install-nudge-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-steps {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.install-steps[hidden] {
  display: none;
}

.install-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dce7c4;
  border-radius: 14px;
  background: rgba(244, 248, 236, 0.82);
}

.install-steps li strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #17202a;
  color: #ffffff;
  font-size: 13px;
}

.install-steps li span {
  color: #243240;
  font-size: 13px;
  font-weight: 600;
}

.ios-install-guide {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}

.ios-install-guide * {
  box-sizing: border-box;
}

.ios-install-scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 28, 0.46);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}

.ios-install-panel {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 24px;
  background:
    radial-gradient(260px 130px at 12% 0%, rgba(135, 181, 31, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 80px rgba(8, 15, 24, 0.34);
  pointer-events: auto;
  animation: content-rise 0.32s var(--transition-slow) both;
}

.ios-install-guide-top .ios-install-panel {
  top: calc(82px + env(safe-area-inset-top));
  bottom: auto;
}

.ios-device-pill {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf7d7;
  color: #40520d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ios-install-panel h2 {
  margin: 0 0 8px;
  color: #17202a;
  font-size: clamp(20px, 5vw, 28px);
  line-height: 1.08;
}

.ios-install-panel p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.ios-guide-steps {
  display: grid;
  gap: 9px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.ios-guide-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dce7c4;
  border-radius: 16px;
  background: rgba(247, 250, 241, 0.92);
}

.ios-guide-steps strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #17202a;
  color: #ffffff;
  font-size: 13px;
}

.ios-guide-steps span {
  color: #243240;
  font-size: 13px;
  font-weight: 700;
}

.ios-guide-actions {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 8px;
}

.ios-share-target {
  position: absolute;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 74px;
  padding: 8px 12px;
  border-radius: 18px;
  background: #ffffff;
  color: #17202a;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 16px 42px rgba(8, 15, 24, 0.32);
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
}

.ios-share-target:focus-visible {
  outline: 3px solid rgba(151, 215, 0, 0.72);
  outline-offset: 4px;
}

.ios-install-guide-top .ios-share-target {
  top: calc(10px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  transform: none;
}

.ios-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid #17202a;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
}

.ios-share-arrow {
  position: absolute;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: 4px;
  height: 54px;
  border-radius: 999px;
  background: #97d700;
  transform: translateX(-50%);
  pointer-events: none;
  animation: ios-arrow-pulse 1.15s ease-in-out infinite;
}

.ios-share-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-right: 4px solid #97d700;
  border-bottom: 4px solid #97d700;
  transform: translateX(-50%) rotate(45deg);
}

.ios-install-guide-top .ios-share-arrow {
  top: calc(74px + env(safe-area-inset-top));
  right: calc(52px + env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  transform: none;
  animation-name: ios-arrow-pulse-top;
}

.ios-install-guide-top .ios-share-arrow::after {
  top: -2px;
  bottom: auto;
  transform: translateX(-50%) rotate(225deg);
}

.ios-install-guide-open {
  overflow: hidden;
}

@keyframes ios-arrow-pulse {
  0%, 100% {
    opacity: 0.72;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(8px);
  }
}

@keyframes ios-arrow-pulse-top {
  0%, 100% {
    opacity: 0.72;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  margin-bottom: 6px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: 0;
}

.admin-recent-list li {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-listing-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-listing-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}

.recent-date {
  flex-shrink: 0;
  font-size: 11px;
  color: #5d5d5d;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  padding: 3px 8px;
}

p,
li,
td,
th,
label,
input,
select,
textarea,
button {
  font-family: inherit;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.kpi {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
  font-weight: 800;
  color: #18212b;
}

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

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

.field {
  grid-column: span 12;
}

.field.half {
  grid-column: span 6;
}

.field.third {
  grid-column: span 4;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #44515e;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.035);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(135, 181, 31, 0.14), 0 10px 24px rgba(20, 32, 43, 0.05);
  transform: translateY(-1px);
}

select.is-dirty {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fbfff3 0%, #eef7dc 100%);
  box-shadow: 0 0 0 3px rgba(135, 181, 31, 0.13), 0 8px 18px rgba(110, 149, 25, 0.08);
}

textarea {
  min-height: 124px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 1px solid #b7c2cc;
  box-shadow: none;
  accent-color: #7db40f;
  flex: 0 0 auto;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 600;
  color: #243240;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid #6f9619;
  border-radius: 12px;
  background: linear-gradient(180deg, #96c530 0%, #7aa61d 100%);
  color: #11200a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform var(--transition-base), background var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), filter var(--transition-base);
  box-shadow: 0 10px 20px rgba(110, 149, 25, 0.18);
}

.btn:hover {
  background: linear-gradient(180deg, #8dbc27 0%, #6e9519 100%);
  color: #11200a;
  border-color: #648916;
  box-shadow: 0 16px 28px rgba(110, 149, 25, 0.22);
  transform: translateY(-2px);
  filter: saturate(1.03);
}

.btn:active {
  transform: translateY(0);
}

.btn.ms {
  width: auto;
  background: linear-gradient(180deg, #171f29 0%, #0f1720 100%);
  color: #ffffff;
  border: 1px solid #24303c;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
}

.btn.ms::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: linear-gradient(90deg, #f25022 0 50%, #7fba00 50% 100%),
              linear-gradient(90deg, #00a4ef 0 50%, #ffb900 50% 100%);
  background-size: 100% 50%;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
  border-radius: 3px;
}

.btn.ms:hover {
  background: linear-gradient(180deg, #1d2833 0%, #121b24 100%);
  color: #ffffff;
  border-color: #334150;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.22);
}

.ms-text {
  font-size: 14px;
  font-weight: 700;
}

.btn.secondary {
  border: 1px solid #bfd08e;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 247, 250, 0.98) 100%);
  color: #385115;
  box-shadow: none;
}

.btn.secondary:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f0f4f7 100%);
  border-color: #a8be6a;
  color: #2c4210;
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #cfdab3;
  color: #43601c;
  box-shadow: none;
}

.btn.subtle:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: #b3c57b;
  color: #314511;
}

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

.form-footer-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5edf2;
}

.approval-form {
  display: grid;
  gap: 10px;
  min-width: 240px;
}

.compact-textarea {
  min-height: 82px;
  padding-top: 10px;
}

.entry-status-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.quick-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-choice-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: none;
}

.time-entry-card {
  overflow: visible;
}

.time-entry-form {
  position: relative;
}

.time-entry-submit {
  justify-content: flex-end;
}

.quick-description-btn {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions select {
  width: auto;
  min-width: 150px;
  flex: 0 1 auto;
}

.table-wrap .actions .btn,
.table-wrap .btn.secondary {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
}

.divider {
  text-align: center;
  color: var(--muted);
  margin: 4px 0 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d9dee5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.badge.pending {
  background: var(--warning-soft);
  border-color: #ead890;
  color: var(--warning);
}

.badge.approved {
  background: var(--success-soft);
  border-color: #bee3c8;
  color: var(--success);
}

.badge.rejected {
  background: var(--danger-soft);
  border-color: #efc3c0;
  color: var(--danger);
}

.table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid #e1e8ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

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

th,
td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid #e5edf2;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.5;
}

th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: #5b6772;
  background: #f5f8fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

tbody tr:nth-child(even) td {
  background: rgba(247, 250, 252, 0.7);
}

tbody tr:hover td {
  background: rgba(238, 244, 223, 0.75);
}

.alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-soft);
}

.alert.error {
  background: var(--danger-soft);
  color: #932727;
  border-color: #f1bebe;
}

.alert.success {
  background: var(--success-soft);
  color: #136439;
  border-color: #b8e2c8;
}

.impersonation-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.impersonation-banner .btn {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(560px, 100%);
  border-top-width: 4px;
}

.welcome-hero {
  background:
    radial-gradient(320px 160px at 100% 0%, rgba(135, 181, 31, 0.12), rgba(135, 181, 31, 0)),
    linear-gradient(135deg, #ffffff 0%, #f3f7e9 100%);
  border: 1px solid var(--border);
  padding: 26px;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.06);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.welcome-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(135, 181, 31, 0.12) 0%, rgba(135, 181, 31, 0) 72%);
  pointer-events: none;
}

.welcome-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(0,0,0,0.08);
  border-color: rgba(135, 181, 31, 0.22);
}

.login-hero h1 {
  margin-bottom: 8px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.login-single {
  display: flex;
  justify-content: center;
}

.login-single .login-card {
  width: min(560px, 100%);
}

.login-card .btn.ms {
  width: 100%;
  justify-content: center;
  margin-bottom: 6px;
}

.login-note {
  margin-top: 10px;
  text-align: center;
}

.login-aside-card {
  align-self: start;
}

.login-feature-list li {
  line-height: 1.55;
}

.site-footer {
  display: block;
  border-top: 1px solid rgba(20, 32, 43, 0.08);
  padding: 22px 0;
  margin-top: 48px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  transition: background var(--transition-base);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding-top: 0;
  padding-bottom: 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  transition: transform var(--transition-base);
}

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

.footer-logo {
  display: block;
  width: 104px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(20, 32, 43, 0.06));
}

@keyframes content-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

.footer-meta {
  font-size: 12px;
}

@media (max-width: 980px) {
  .site-header-inner {
    width: 100%;
    padding: 14px 24px;
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-logo {
    width: 104px;
  }

  .admin-shell-bar,
  .admin-two-col,
  .metric-grid,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell-bar {
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  html,
  body {
    min-height: 100dvh;
    min-height: var(--app-height);
  }

  body.is-authenticated {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .container {
    width: min(100%, 540px);
    padding: 10px 10px 22px;
  }

  .site-header {
    position: sticky;
    top: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    transform: translateY(0);
  }

  body.mobile-header-hidden .site-header {
    transform: translateY(calc(-100% - 8px));
  }

  .site-header-inner {
    gap: 7px;
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-link {
    gap: 8px;
    padding: 3px 0;
  }

  .brand-logo {
    width: 70px;
  }

  .brand-text {
    font-size: 17px;
  }

  .brand-subtitle {
    display: none;
  }

  .col-3,
  .col-4,
  .col-6,
  .col-8,
  .col-12,
  .field.half,
  .field.third {
    grid-column: span 12;
  }

  .site-nav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    padding: 4px 0 1px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }

  .site-nav a::before {
    display: none;
  }

  .site-nav a {
    font-size: 11px;
  }

  .site-nav a.is-current {
    box-shadow: 0 10px 20px rgba(110, 149, 25, 0.2);
  }

  .site-nav.has-horizontal-overflow::after {
    display: none;
  }

  .swipe-hint-button {
    min-width: 66px;
    min-height: 32px;
    margin-top: 6px;
    padding: 6px 10px;
  }

  .footer-logo {
    width: 92px;
  }

  .actions select {
    width: 100%;
    min-width: 0;
  }

  .profile-pill {
    display: none;
  }

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

  .admin-listing-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-shell-bar {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .admin-shell-title {
    font-size: 23px;
  }

  .admin-shell-lead {
    display: none;
  }

  .admin-shell-actions {
    width: 100%;
  }

  .admin-shell-actions .btn {
    width: 100%;
  }

  .install-app-card {
    align-items: stretch;
    flex-direction: column;
  }

  .install-app-actions {
    align-items: stretch;
    max-width: none;
    text-align: left;
  }

  .card {
    padding: 12px;
    border-radius: 16px;
  }

  .card::before,
  .card::after {
    display: none;
  }

  h1 {
    font-size: 23px;
  }

  h2 {
    font-size: 17px;
    margin-bottom: 8px;
  }

  h1::after,
  h2::after {
    width: 32px;
    height: 3px;
    margin-top: 5px;
  }

  .admin-section-stack,
  .grid,
  form.inline,
  .form-grid {
    gap: 10px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card {
    gap: 5px;
    min-height: 86px;
    padding: 11px 9px;
    border-radius: 15px;
  }

  .metric-label {
    font-size: 9px;
    letter-spacing: 0.5px;
    line-height: 1.15;
  }

  .metric-value {
    font-size: clamp(23px, 8vw, 31px);
  }

  .metric-link {
    display: none;
  }

  .quick-action-card {
    min-height: 88px;
    padding: 12px;
    border-radius: 14px;
  }

  .quick-action-card strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .quick-action-card span {
    font-size: 12px;
    line-height: 1.35;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
    border-radius: 13px;
    padding: 9px 11px;
  }

  textarea {
    min-height: 86px;
  }

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

  .quick-choice-btn {
    min-height: 36px;
    width: 100%;
    padding: 8px 10px;
  }

  .quick-description-btn {
    grid-column: span 3;
    justify-content: flex-start;
    text-align: left;
  }

  .time-entry-submit {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 15;
    margin: 6px -8px -8px;
    padding: 10px 8px 8px;
    justify-content: stretch;
    border-top: 1px solid rgba(20, 32, 43, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.96) 28%, rgba(255,255,255,0.98));
    backdrop-filter: blur(10px);
  }

  .time-entry-submit .btn {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
  }

  .time-entry-overview .table-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .time-entry-overview table,
  .time-entry-overview thead,
  .time-entry-overview tbody,
  .time-entry-overview tr,
  .time-entry-overview th,
  .time-entry-overview td {
    display: block;
  }

  .time-entry-overview thead {
    display: none;
  }

  .time-entry-overview tr {
    margin-bottom: 9px;
    padding: 11px;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  .time-entry-overview td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #edf2f5;
    background: transparent !important;
  }

  .time-entry-overview td:last-child {
    border-bottom: 0;
  }

  .time-entry-overview td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: #66727e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.55px;
    text-transform: uppercase;
  }

  .time-entry-overview td[data-label="Omschrijving"],
  .time-entry-overview td[data-label="Review"] {
    display: block;
  }

  .time-entry-overview td[data-label="Omschrijving"]::before,
  .time-entry-overview td[data-label="Review"]::before {
    display: block;
    margin-bottom: 4px;
  }

  .mobile-card-table {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .mobile-card-table.has-horizontal-overflow::after {
    display: none;
  }

  .mobile-card-table table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table th,
  .mobile-card-table td {
    display: block;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tr {
    margin-bottom: 9px;
    padding: 11px;
    border: 1px solid #e1e8ed;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.06);
  }

  .mobile-card-table td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px solid #edf2f5;
    background: transparent !important;
    overflow-wrap: anywhere;
  }

  .mobile-card-table td:last-child {
    border-bottom: 0;
  }

  .mobile-card-table td::before {
    content: attr(data-label);
    color: #66727e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.45px;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .mobile-card-table td[data-label="Omschrijving"],
  .mobile-card-table td[data-label="Review"],
  .mobile-card-table td[data-label="Reviewopmerking"] {
    display: block;
  }

  .mobile-card-table td[data-label="Omschrijving"]::before,
  .mobile-card-table td[data-label="Review"]::before,
  .mobile-card-table td[data-label="Reviewopmerking"]::before {
    display: block;
    margin-bottom: 4px;
  }

  .install-nudge {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .install-nudge.is-expanded {
    top: auto;
  }

  .install-nudge-actions {
    display: grid;
    grid-template-columns: 1fr 0.7fr;
  }

  .install-nudge-actions .btn {
    min-height: 42px;
    padding: 9px 12px;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 64px;
  }

  .brand-text {
    font-size: 16px;
  }

  .metric-card {
    padding: 10px 7px;
    border-radius: 14px;
  }

  .metric-value {
    font-size: 24px;
  }

  .site-nav {
    gap: 5px;
    padding: 3px 0 1px;
    border-radius: 0;
  }

  .site-nav a {
    min-width: auto;
    min-height: 32px;
    padding: 8px 9px;
    font-size: 10px;
  }

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

  .quick-description-btn {
    grid-column: span 2;
  }
}

@media (max-height: 720px) and (max-width: 900px) {
  .admin-shell-bar {
    padding: 10px;
  }

  .admin-shell-lead {
    display: none;
  }

  .card {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .install-nudge:not(.is-expanded) .install-nudge-copy > span {
    display: none;
  }
}
