:root {
  color-scheme: light;
  --ink: #14263a;
  --muted: #64748b;
  --navy: #102a43;
  --blue: #1261a0;
  --cyan: #17a9c3;
  --line: #dce5ec;
  --surface: #ffffff;
  --canvas: #f3f7fa;
  --green: #16866a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(23, 169, 195, 0.12), transparent 28rem),
    var(--canvas);
  font-family:
    Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
}

.topbar {
  min-height: 78px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(220, 229, 236, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: min(330px, 42vw);
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--cyan));
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.environment,
.count {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-menu a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card,
.panel {
  width: min(460px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(16, 42, 67, 0.12);
}

.auth-card h1 {
  margin: 28px 0 8px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.auth-card > p {
  margin: 0 0 28px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd8e2;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(23, 169, 195, 0.15);
  border-color: var(--cyan);
}

button,
.button {
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.button.secondary {
  color: var(--blue);
  background: #e9f2f7;
}

.zoho-button {
  display: block;
  margin-bottom: 22px;
  text-align: center;
}

.separator {
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.separator::before,
.separator::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line);
}

.flash {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e8f6f1;
  color: #11664f;
  font-size: 14px;
}

.flash.error {
  color: #9b2c2c;
  background: #fff0f0;
}

.admin-main {
  width: min(1180px, 92vw);
  margin: 42px auto 80px;
}

.admin-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-header h1 {
  font-size: 38px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.panel {
  width: 100%;
  margin-bottom: 20px;
  box-shadow: 0 12px 36px rgba(16, 42, 67, 0.06);
}

.panel h2 {
  margin-bottom: 20px;
}

.user-row {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr auto auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
}

.user-row:first-of-type {
  border-top: 0;
}

.permission-row {
  margin: -8px 0 8px;
  padding: 12px 0 20px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 3fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.permission-list .checkbox {
  padding: 0;
  font-weight: 600;
}

.permission-note {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  grid-column: 1 / -1;
}

.checkbox {
  display: flex;
  align-items: center;
  padding-bottom: 12px;
}

.checkbox input {
  width: auto;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-table th,
.audit-table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.audit-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

main {
  width: min(1180px, 88vw);
  margin: 0 auto;
}

.hero {
  padding: 88px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 630px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.tools {
  padding: 0 0 90px;
}

.section-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.025em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  min-height: 285px;
  padding: 28px;
  display: flex;
  gap: 24px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 14px 44px rgba(16, 42, 67, 0.055);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

a.tool-card:hover {
  transform: translateY(-4px);
  border-color: #9cc8dc;
  box-shadow: 0 22px 60px rgba(16, 42, 67, 0.12);
}

.tool-card.primary {
  background:
    linear-gradient(135deg, rgba(18, 97, 160, 0.055), rgba(23, 169, 195, 0.08)),
    var(--surface);
}

.icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.primary .icon {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.card-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.status i {
  width: 7px;
  height: 7px;
  background: #26ad83;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(38, 173, 131, 0.11);
}

.status.muted {
  color: var(--muted);
}

h3 {
  margin: 14px 0 10px;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.action {
  margin-top: auto;
  padding-top: 24px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
}

.action b {
  margin-left: 5px;
  font-size: 18px;
}

.coming-soon {
  min-height: 220px;
  border-style: dashed;
  box-shadow: none;
  opacity: 0.78;
}

.coming-soon .icon {
  color: var(--muted);
  background: #e8eef3;
}

footer {
  min-height: 76px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

@media (max-width: 780px) {
  .topbar,
  footer {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  main {
    width: 90vw;
  }

  .hero {
    padding: 62px 0 52px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 260px;
  }

  .environment,
  .count {
    display: none;
  }

  .user-menu {
    gap: 9px;
  }

  .brand-logo {
    width: min(210px, 46vw);
    height: 44px;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .permission-row {
    grid-template-columns: 1fr;
  }
}
