:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #66736d;
  --line: #dce5df;
  --accent: #087f5b;
  --accent-dark: #065f46;
  --warm: #f59f00;
  --shadow: 0 18px 45px rgba(23, 33, 28, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 127, 91, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(245, 159, 0, 0.14), transparent 32%),
    var(--bg);
}

body.public-body {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
  color: #0d2a43;
  background: #f1f2f4;
}

body.modal-open {
  overflow: hidden;
}

body.gate-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(8, 127, 91, 0.16), transparent 30%),
    radial-gradient(circle at 86% 78%, rgba(245, 159, 0, 0.18), transparent 32%),
    #f3f6f4;
}

button,
a.button,
input,
select {
  font: inherit;
}

.gate-shell {
  display: grid;
  gap: 18px;
  width: min(100%, 440px);
  justify-items: center;
}

.gate-logo {
  display: block;
  width: min(280px, 88vw);
  height: auto;
  object-fit: contain;
}

.gate-panel {
  width: 100%;
  padding: 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.gate-eyebrow {
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.gate-panel h1 {
  margin-top: 8px;
  font-size: 28px;
}

.gate-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.gate-button {
  width: 100%;
  margin-top: 22px;
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 46px;
}

.public-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.public-logo img {
  display: block;
  width: auto;
  max-width: 170px;
  max-height: 200px;
  object-fit: contain;
}

.join-button {
  display: inline-grid;
  min-width: 100px;
  min-height: 42px;
  padding: 0 22px;
  place-items: center;
  color: #fff;
  background: #2f8ded;
  border-radius: 999px;
  border: 0;
  box-shadow: 0 9px 18px rgba(47, 141, 237, 0.32);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.join-button:hover {
  background: #1f78d7;
}

.public-hero {
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 66px 24px 40px;
}

.public-hero h1 {
  color: #113451;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
}

.public-hero h1 span {
  display: inline-block;
  border-bottom: 2px dotted rgba(17, 52, 81, 0.42);
}

.public-url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  width: min(768px, calc(100vw - 42px));
  min-height: 68px;
  margin-top: 58px;
  padding: 0 10px 0 34px;
  background: #fff;
  border-radius: 999px;
  box-shadow:
    0 24px 52px rgba(28, 42, 57, 0.08),
    0 7px 0 rgba(26, 39, 52, 0.06);
}

.public-url-box input {
  min-height: 50px;
  padding: 0;
  color: #16354f;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
  letter-spacing: 0;
}

.public-url-box input:focus {
  border-color: transparent;
  box-shadow: none;
}

.public-url-box input::placeholder {
  color: #6f7883;
}

.public-url-box button {
  width: 54px;
  min-height: 54px;
  padding: 0;
  color: #9c9c9c;
  background: transparent;
  border-radius: 50%;
  box-shadow: none;
}

.public-url-box button:hover {
  color: #2f8ded;
  background: transparent;
}

.public-url-box svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-footer {
  min-height: 76px;
  padding: 24px;
  color: #123553;
  background: #fff;
  font-size: 12px;
  text-align: center;
}

.public-modal[hidden] {
  display: none;
}

.public-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 22, 34, 0.48);
}

.public-modal-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  padding: 30px;
  color: #112d46;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(9, 22, 35, 0.28);
}

.public-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  color: #5d6975;
  background: #f2f5f7;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.public-modal-close:hover {
  color: #113451;
  background: #e6eef5;
}

.public-modal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-modal-card h2 {
  max-width: 360px;
  color: #0f304c;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.24;
}

.public-modal-content {
  display: grid;
  gap: 14px;
  color: #24384a;
  font-size: 15px;
  line-height: 1.55;
}

.public-modal-content ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
}

.public-price {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #f4f8fb;
  border: 1px solid #e0e8ee;
  border-radius: 10px;
}

.public-price span {
  font-weight: 800;
}

.public-modal-join {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: #fff;
  background: #2f8ded;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(47, 141, 237, 0.25);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.public-modal-join:hover {
  background: #1f78d7;
}

@media (max-width: 640px) {
  body.public-body {
    min-height: 100svh;
    background:
      linear-gradient(180deg, rgba(47, 141, 237, 0.08), transparent 38%),
      #f1f2f4;
  }

  .public-topbar {
    padding: 14px 12px 8px;
    gap: 10px;
  }

  .public-logo {
    min-height: 64px;
    min-width: 0;
  }

  .public-logo img {
    max-width: clamp(168px, 58vw, 212px);
    max-height: 86px;
  }

  .join-button {
    min-width: 0;
    min-height: 36px;
    padding: 0 12px;
    box-shadow: 0 7px 14px rgba(47, 141, 237, 0.24);
    font-size: 11px;
    white-space: nowrap;
  }

  .public-hero {
    align-content: start;
    padding: 44px 14px 28px;
  }

  .public-hero h1 {
    max-width: 330px;
    font-size: 25px;
    font-weight: 500;
  }

  .public-url-box {
    grid-template-columns: minmax(0, 1fr) 46px;
    width: 100%;
    min-height: 58px;
    margin-top: 38px;
    padding: 0 7px 0 22px;
    box-shadow:
      0 18px 40px rgba(28, 42, 57, 0.09),
      0 6px 0 rgba(26, 39, 52, 0.055);
  }

  .public-url-box input {
    min-height: 44px;
    font-size: 15px;
  }

  .public-url-box button {
    width: 44px;
    min-height: 44px;
  }

  .public-url-box svg {
    width: 24px;
    height: 24px;
  }

  .public-footer {
    min-height: 58px;
    padding: 18px 12px;
  }

  .public-modal {
    align-items: end;
    padding: 12px;
  }

  .public-modal-card {
    width: 100%;
    max-height: calc(100svh - 24px);
    overflow: auto;
    gap: 14px;
    padding: 24px 18px 18px;
    border-radius: 16px;
  }

  .public-modal-close {
    top: 10px;
    right: 10px;
  }

  .public-modal-card h2 {
    max-width: calc(100% - 34px);
    font-size: 20px;
  }

  .public-modal-content {
    gap: 12px;
    font-size: 14px;
  }

  .public-modal-content ol {
    gap: 6px;
    padding-left: 20px;
  }

  .public-price {
    padding: 12px;
  }

  .public-modal-join {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .public-logo img {
    max-width: 156px;
    max-height: 76px;
  }

  .join-button {
    padding: 0 10px;
    font-size: 10px;
  }

  .public-hero {
    padding-top: 38px;
  }
}

.app {
  width: 100%;
  min-height: 100vh;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
}

.panel {
  padding: 28px;
}

.brand {
  display: block;
  text-align: center;
  margin: -30px 0 18px;
}

.brand > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 225px;
  max-height: 150px;
  margin: 0 auto 8px;
  object-fit: contain;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--warm);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
}

.nav a:hover,
.nav a.active {
  background: #e8f4ef;
  color: var(--accent-dark);
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin-left: 260px;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.user-menu {
  position: relative;
  justify-self: end;
}

.user-menu summary {
  display: grid;
  min-height: 40px;
  padding: 0 14px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  display: grid;
  width: 180px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.user-dropdown a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.user-dropdown a:hover {
  background: #e8f4ef;
}

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

.login-panel {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.login-panel h1 {
  font-size: 26px;
}

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

.partner-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.partner-link:hover {
  color: var(--accent-dark);
}

.creator {
  display: grid;
  gap: 16px;
}

.narrow-form {
  max-width: 520px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(8, 127, 91, 0.12);
}

button {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

button:hover,
a.button:hover {
  background: var(--accent-dark);
}

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

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

.notice {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.notice a {
  color: inherit;
  overflow-wrap: anywhere;
}

.notice span {
  display: block;
  margin-top: 4px;
}

.notice.success {
  color: #064e3b;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.notice.error {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #fecaca;
}

.limit-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 28, 0.36);
}

.limit-modal > div {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.limit-modal strong {
  font-size: 22px;
}

.limit-modal a {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 240px;
  align-content: center;
  justify-items: start;
}

.empty-state h2 {
  font-size: 28px;
}

.empty-state p {
  color: var(--muted);
}

.table-wrap {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.table-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.links-list {
  display: grid;
}

.users-list,
.domains-list {
  display: grid;
}

.users-header,
.users-row {
  display: grid;
  grid-template-columns: 120px minmax(260px, 1fr) 140px 110px 130px 58px;
  align-items: center;
  column-gap: 18px;
}

.users-header {
  min-height: 46px;
  padding: 0 18px;
  color: var(--ink);
  background: #f8fbf9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.domains-header,
.domains-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(160px, 0.8fr) minmax(190px, 0.9fr) 140px 58px;
  align-items: center;
  column-gap: 18px;
}

.domains-header {
  min-height: 46px;
  padding: 0 18px;
  color: var(--ink);
  background: #f8fbf9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.domains-row {
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.domains-row:last-child {
  border-bottom: 0;
}

.domain-access-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.domain-access-summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-access-summary .text-icon-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.domain-access-summary .text-icon-button svg {
  width: 14px;
  height: 14px;
}

.domain-access-editor {
  display: grid;
  grid-template-columns: minmax(170px, 0.65fr) minmax(260px, 0.9fr) minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.domain-access-modes {
  display: grid;
  gap: 8px;
}

.domain-access-modes label,
.domain-member-list label {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.domain-member-list label[hidden] {
  display: none;
}

.domain-access-modes input,
.domain-member-list input {
  width: 16px;
  min-height: 16px;
}

.domain-member-picker {
  display: grid;
  gap: 10px;
}

.domain-member-picker[hidden] {
  display: none;
}

.domain-member-picker input[type="search"] {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.domain-member-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  min-height: 0;
  max-height: 170px;
  overflow: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.domain-access-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.domain-add-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.domain-add-form input {
  min-height: 42px;
}

.users-row {
  min-height: 78px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.users-row:last-child {
  border-bottom: 0;
}

.mini-form,
.limit-form,
.status-form,
.delete-user-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-form input,
.limit-form input,
.status-form select {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.limit-form input {
  width: 78px;
}

.limit-display {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.limit-form.editing {
  gap: 6px;
}

.limit-form.editing input {
  width: 70px;
  min-height: 30px;
  padding: 0 8px;
}

.tiny-icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
}

.tiny-icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tiny-icon-button:hover {
  color: var(--ink);
  background: #eef6f2;
  border-color: #b9d7ca;
}

.access-summary {
  display: flex;
  align-items: center;
}

.text-icon-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.text-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-icon-button:hover {
  background: #eef6f2;
  border-color: #b9d7ca;
}

.access-editor {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 18px;
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.password-editor {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 18px;
  background: #fbfdfc;
  border-bottom: 1px solid var(--line);
}

.password-editor input {
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.access-editor-group {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.access-editor-group span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-editor label {
  display: inline-flex;
  grid-template-columns: none;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.access-editor input {
  width: 16px;
  min-height: 16px;
}

.access-editor button,
.button-link {
  display: inline-grid;
  min-height: 38px;
  padding: 0 14px;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.button-link {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.delete-user-form {
  justify-content: end;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.links-header,
.links-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 140px 80px 64px;
  align-items: center;
  column-gap: 18px;
}

.links-list.hide-clicks .links-header,
.links-list.hide-clicks .links-row {
  grid-template-columns: 52px minmax(0, 1fr) 140px 64px;
}

.links-list.hide-delete .links-header,
.links-list.hide-delete .links-row {
  grid-template-columns: 52px minmax(0, 1fr) 140px 80px;
}

.links-list.hide-clicks.hide-delete .links-header,
.links-list.hide-clicks.hide-delete .links-row {
  grid-template-columns: 52px minmax(0, 1fr) 140px;
}

.links-header {
  min-height: 46px;
  padding: 0 18px;
  color: var(--ink);
  background: #f8fbf9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.links-row {
  min-height: 78px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.links-row:last-child {
  border-bottom: 0;
}

.links-row:hover {
  background: #f7fbf8;
}

.created-at {
  color: var(--muted);
  font-size: 13px;
}

.links-header .clicks-head,
.links-row .clicks {
  text-align: center;
}

.links-header .delete-head,
.links-row .delete-form {
  justify-self: end;
}

.link-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.short-row {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.short {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short:hover {
  text-decoration: underline;
}

.destination {
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-row,
.inline-edit {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  gap: 6px;
  align-items: center;
  justify-content: start;
}

.destination-row .icon-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 6px;
}

.destination-row .icon-button svg {
  width: 14px;
  height: 14px;
}

.inline-edit {
  grid-template-columns: minmax(180px, 420px) auto auto;
}

.inline-edit input {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.delete-form {
  margin: 0;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  color: var(--ink);
  background: #eef6f2;
  border-color: #b9d7ca;
}

.icon-button.copy-button {
  width: 16px;
  height: 16px;
  min-height: 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 3px;
}

.icon-button.copy-button svg {
  width: 12px;
  height: 12px;
}

.icon-button.copy-button.copied {
  color: var(--accent);
  background: #d1fae5;
}

.icon-button.copy-button:hover {
  color: var(--ink);
  background: transparent;
}

.danger {
  color: var(--ink);
  background: #fff;
}

.danger:hover {
  color: var(--ink);
  background: #fff1f2;
  border-color: #fecdd3;
}

@media (max-width: 700px) {
  .app {
    grid-template-columns: 1fr;
    gap: 12px;
    width: min(100% - 20px, 1080px);
    padding: 18px 0;
  }

  .sidebar {
    position: static;
    width: auto;
    min-height: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .content {
    margin-left: 0;
    padding: 0;
  }

  .panel {
    padding: 18px;
  }

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

  .nav a {
    justify-content: center;
    padding: 0 8px;
  }

  .url-row,
  .fields {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand {
    margin-top: 0;
  }

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

  .links-list,
  .users-list,
  .domains-list {
    min-width: 680px;
  }

  .users-list {
    min-width: 980px;
  }

  .domains-list {
    min-width: 980px;
  }

  .domain-add-form {
    min-width: 760px;
  }

  .domain-access-editor {
    min-width: 980px;
  }
}
/* ===== TAMBAH USER ===== */

.user-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr) auto;
    gap: 16px;
    align-items: end;
    margin: 0;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfdfc;
}

.user-add-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.2fr 0.8fr;
    gap: 12px;
}

.user-add-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
}

.user-add-grid input {
    width: 100%;
}

.user-access-columns {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.user-access-box {
    display: grid;
    gap: 10px;
    align-self: stretch;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.user-access-box strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.2;
}

.user-access-list {
    display: flex;
    gap: 12px 16px;
    align-items: center;
    flex-wrap: wrap;
}

.user-access-list label {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.user-access-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
}

.user-add-actions {
    align-self: stretch;
    justify-self: stretch;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.user-add-actions button,
.user-add-actions .button-link {
    min-width: 110px;
    justify-content: center;
}

@media (max-width: 900px) {
    .user-add-form {
        grid-template-columns: 1fr;
    }

    .user-add-grid {
        grid-template-columns: 1fr;
    }

    .user-access-box,
    .user-add-actions {
        grid-column: auto;
    }

    .user-access-columns {
        grid-template-columns: 1fr;
    }

    .user-access-list {
        gap: 10px 14px;
    }

    .user-add-actions {
        justify-self: stretch;
        flex-direction: column;
        align-items: stretch;
    }
}
