:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #2563eb;
  --gold: #f59e0b;
  --danger: #b42318;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --shadow: 0 18px 45px rgba(18, 52, 59, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%);
  min-height: 100vh;
}

a {
  color: var(--brand);
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  color: #fff;
  background: rgba(18, 52, 59, 0.97);
  box-shadow: 0 10px 30px rgba(18, 52, 59, 0.18);
  backdrop-filter: blur(10px);
}

.topbar span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #d6e4e5;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar nav a {
  color: #fff;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
}

.topbar nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 40px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 52, 59, 0.06);
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.page-title h1 {
  margin: 0;
  font-size: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 52, 59, 0.06);
}

.stat::after {
  position: absolute;
  top: -24px;
  right: -24px;
  width: 72px;
  height: 72px;
  content: "";
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
}

.stat span {
  color: var(--muted);
}

.stat small {
  display: inline-block;
  margin-top: 12px;
  color: var(--brand);
  font-weight: 700;
}

.stat-card {
  min-height: 150px;
}

.stat-card:hover {
  border-color: rgba(15, 118, 110, 0.45);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 8px;
  font-weight: 800;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(15, 118, 110, 0.13);
}

textarea {
  min-height: 78px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn.secondary {
  color: var(--ink);
  background: #e9eef5;
}

.btn.danger {
  background: var(--danger);
}

.btn.full {
  width: 100%;
}

.btn.light {
  color: #12343b;
  background: #ffffff;
}

.btn.outline {
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(18, 52, 59, 0.14);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 52, 59, 0.05);
}

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

.compact table {
  min-width: 680px;
}

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

th {
  font-size: 13px;
  background: #eef3f7;
}

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

.notice {
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #064e3b;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
}

.login {
  max-width: 420px;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-page {
  min-height: 100vh;
}

.login-page .container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 64px);
  margin: 0;
  padding: 32px 16px;
}

.login-page .topbar {
  position: static;
  min-height: 64px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-brand strong {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #ffffff;
  background: #12343b;
  border-radius: 8px;
  font-size: 20px;
}

.login-brand h1 {
  margin: 0;
  font-size: 24px;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 28px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(18, 52, 59, 0.98), rgba(15, 118, 110, 0.92)),
    linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.dashboard-hero {
  min-height: 260px;
}

.hero h1 {
  margin: 8px 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: #d9fffb;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-meta span {
  padding: 7px 10px;
  color: #ecfeff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.eyebrow {
  color: #fef3c7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.hero-card {
  display: grid;
  gap: 8px;
  width: min(100%, 280px);
  padding: 20px;
  color: #12343b;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.hero-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #ffffff;
  background: #12343b;
  border-radius: 8px;
  font-weight: 800;
}

.hero-card strong {
  font-size: 40px;
  line-height: 1;
}

.hero-card span {
  color: var(--muted);
  font-weight: 700;
}

.hero-card .hero-actions {
  margin-top: 8px;
}

.hero-card .btn.outline {
  color: #12343b;
  border-color: rgba(18, 52, 59, 0.2);
}

.stats-grid {
  margin-bottom: 18px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2,
.panel h2 {
  margin-top: 0;
}

.quick-list {
  display: grid;
  gap: 10px;
}

.quick-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.quick-list a span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: #12343b;
  border-radius: 6px;
  font-size: 12px;
}

.quick-list a:hover {
  border-color: rgba(15, 118, 110, 0.5);
  background: #ecfdf5;
}

.api-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

code {
  overflow-wrap: anywhere;
  color: #0f172a;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: #075985;
  background: #e0f2fe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .topbar nav {
    width: 100%;
    gap: 6px;
  }

  .topbar nav a {
    flex: 1 1 auto;
    min-width: 92px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
  }

  .container {
    width: min(100% - 20px, 1180px);
    margin-top: 14px;
  }

  .login-page .container {
    width: 100%;
    min-height: calc(100vh - 64px);
    margin: 0;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .dashboard-hero {
    min-height: auto;
  }

  .hero-card {
    width: 100%;
  }

  .hero-actions,
  .hero-actions .btn {
    width: 100%;
  }

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

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

@media (max-width: 520px) {
  .form-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 9px;
  }
}

.print-page {
  background: #ffffff;
}

.print-sheet {
  width: min(760px, calc(100% - 32px));
  margin: 36px auto;
  color: #111827;
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

.print-sheet h1 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 22px;
}

.print-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.print-table td {
  padding: 3px 4px;
  border: 0;
  font-size: 16px;
}

.print-table td:first-child {
  width: 180px;
}

.print-table td:nth-child(2) {
  width: 16px;
}

.statement {
  margin-top: 34px;
  font-size: 16px;
}

.signature-block {
  margin-top: 40px;
  width: 260px;
  text-align: center;
}

.signature-date,
.signature-role,
.signature-name {
  margin: 0;
  font-size: 16px;
}

.sign-space {
  height: 78px;
}

.signature-name {
  margin-top: 28px;
  font-weight: 700;
}

.print-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 32px;
}

@media print {
  .print-actions,
  button,
  a.btn {
    display: none;
  }

  .print-sheet {
    width: 100%;
    margin: 0;
  }

  body {
    background: #ffffff;
  }
}
