:root {
  font-family: Inter, Arial, sans-serif;
  color: #202b36;
  background: #f5f5f0;
  font-synthesis: none;
  --ink: #172a35;
  --muted: #70808a;
  --orange: #d95332;
  --line: #e1e5df;
  --green: #d9e8ae;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 15px;
  font-weight: 600;
}
button:hover {
  border-color: #a5b2a1;
  background: #f7f9f1;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
button.accent {
  background: var(--orange);
  color: white;
  border: 0;
}
button.danger {
  color: #b0382b;
  border-color: #e5c8c4;
}
button.small {
  padding: 7px 10px;
  font-size: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #eff4ed;
  padding: 30px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-mark {
  background: #d8e8ae;
  color: var(--ink);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 25px;
}
.brand small {
  display: block;
  letter-spacing: 2.5px;
  font-size: 9px;
  font-weight: 500;
  color: #a6b5b9;
  margin-top: 4px;
}
.nav-label {
  color: #90a3a9;
  font-size: 10px;
  letter-spacing: 1.7px;
  padding: 0 12px;
  margin: 6px 0 14px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav button {
  border: 0;
  background: transparent;
  color: #adbdc3;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  padding: 13px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.nav button.active {
  background: #30454d;
  color: #fff;
}
.nav button:hover {
  background: #263d47;
}
.nav-icon {
  width: 20px;
  font-size: 17px;
  text-align: center;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #354852;
  padding-top: 20px;
  font-size: 12px;
  line-height: 1.8;
  color: #aabbc0;
}
.online {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: #cee1a0;
  margin-right: 6px;
}
.main {
  min-width: 0;
  padding: 0 40px 40px;
}
.topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  gap: 12px;
}
.avatar {
  border-radius: 100%;
  width: 30px;
  height: 30px;
  background: #e8dfce;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0 24px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 10px;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 10px;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 0 0 8px;
  font-weight: 700;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
  margin: 0 0 16px;
}
h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px 22px;
  background: white;
}
.stat:first-child {
  background: var(--green);
  border-color: var(--green);
}
.stat-label {
  font-size: 11px;
  color: #637164;
  margin-bottom: 18px;
}
.stat-number {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
}
.stat-foot {
  font-size: 10px;
  color: #7b897e;
  margin-top: 10px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
.panel-pad {
  padding: 24px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 {
  font-size: 16px;
  margin: 0;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}
.filters label {
  font-size: 10px;
  margin: 0;
  color: var(--muted);
}
.filters input,
.filters select {
  padding: 9px 10px;
  font-size: 12px;
  margin-top: 5px;
  max-width: 190px;
}
.filters .search {
  flex: 1;
  min-width: 170px;
  max-width: 290px;
}
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  padding: 17px 0;
  color: var(--muted);
  font-size: 12px;
  background: none;
  white-space: nowrap;
}
.tabs button.selected {
  border-bottom: 2px solid var(--orange);
  color: var(--ink);
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  padding: 15px 22px;
  color: #85918a;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #fafbf8;
  font-weight: 500;
  white-space: nowrap;
}
td {
  padding: 18px 22px;
  border-top: 1px solid #eef0eb;
  vertical-align: middle;
}
tbody tr:hover {
  background: #fafbf7;
}
.title-cell {
  min-width: 230px;
  max-width: 380px;
}
.title-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 5px 0;
  line-height: 1.4;
}
.meta {
  font-size: 10px;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 5px;
  background: #edf0f2;
  font-size: 10px;
  white-space: nowrap;
  font-weight: 500;
}
.badge.SUBMITTED,
.badge.RESUBMITTED,
.badge.REQUESTED {
  background: #e6edfa;
  color: #436086;
}
.badge.IN_REVIEW {
  background: #fff1d7;
  color: #997023;
}
.badge.APPROVED,
.badge.PAID {
  background: #e8f1dc;
  color: #557637;
}
.badge.REJECTED,
.badge.REVOKED,
.badge.FAILED {
  background: #f8e5df;
  color: #aa4b38;
}
.badge.CHANGES_REQUESTED {
  background: #f4e9f4;
  color: #895584;
}
.warning {
  background: #fff5df;
  border: 1px solid #f0dfb6;
  color: #8d6a2b;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 20px;
}
.empty {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  width: 58px;
  height: 58px;
  background: #eff3e8;
  color: #7c9867;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 25px;
  margin: 0 auto 18px;
}
.empty h3 {
  font-size: 17px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.round-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.round-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  border-top: 3px solid #cddfab;
}
.round-card.archived {
  opacity: 0.7;
  border-top-color: #b4baba;
}
.round-card h2 {
  font-size: 20px;
  margin-top: 14px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.spacer {
  margin-top: 18px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 15px;
  line-height: 1.6;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  border: 1px solid #dce1d9;
  border-radius: 7px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  margin-top: 6px;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-right: 7px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 18px 0;
}
legend {
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.check-group label {
  margin: 0;
  font-weight: 400;
}
.help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.rules-preview {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13px;
  background: #f6f8f1;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 8px;
  max-height: 420px;
  overflow: auto;
}
.error {
  color: #ad3e31;
  background: #fff0ea;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  margin: 12px 0;
}
.success {
  color: #557637;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
dialog {
  width: min(940px, 95vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid #dde2d8;
  border-radius: 14px;
  box-shadow: 0 30px 100px #172a3530;
  color: var(--ink);
}
dialog::backdrop {
  background: #14252eb3;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 22px 26px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-content {
  padding: 26px;
}
.close {
  background: none;
  border: 0;
  font-size: 20px;
}
.review-content {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13px;
  padding: 18px;
  background: #f7f8f4;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.diff del {
  background: #fae5df;
}
.diff ins {
  background: #e6f0d5;
  text-decoration: none;
}
.timeline {
  border-left: 2px solid #dce5d4;
  padding-left: 18px;
  margin: 18px 0;
}
.timeline p {
  margin: 0 0 14px;
  font-size: 12px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  background: var(--ink);
  color: white;
  padding: 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art h1 {
  font-size: 54px;
  line-height: 1.12;
  max-width: 450px;
  letter-spacing: -2px;
}
.login-art p {
  color: #adbec2;
  max-width: 350px;
  font-size: 14px;
}
.login-accent {
  color: #d8e8ae;
}
.login-form {
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-form form {
  width: 100%;
  max-width: 360px;
}
.login-form h2 {
  font-size: 27px;
}
.login-form button {
  width: 100%;
}
.login-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 25px;
  line-height: 1.7;
}
.login-footer {
  font-size: 11px;
  letter-spacing: 2px;
  color: #a8bab8;
}
.initial {
  padding: 70px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  max-width: 400px;
  background: var(--ink);
  color: white;
  padding: 15px 22px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 8px 30px #172a3530;
  display: none;
  z-index: 20;
}
.mobile-nav {
  display: none;
}
.mono {
  font-family: monospace;
  overflow-wrap: anywhere;
}
.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.payment {
  background: #f7f8f3;
  border-radius: 8px;
  padding: 18px;
  margin: 15px 0;
}
.payment strong {
  font-size: 26px;
}
.nowrap {
  white-space: nowrap;
}
a {
  color: #416b65;
}
.footer-note {
  font-size: 10px;
  color: #929c93;
  margin-top: 30px;
}
@media (max-width: 1100px) {
  .main {
    padding: 0 24px 24px;
  }
  .shell {
    grid-template-columns: 200px 1fr;
  }
  .sidebar {
    padding: 25px 15px;
  }
  .summary {
    gap: 10px;
  }
  .stat {
    padding: 17px;
  }
  .stat-number {
    font-size: 25px;
  }
  td,
  th {
    padding: 15px;
  }
  .grid2 {
    gap: 14px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    gap: 15px;
  }
  .sidebar .brand {
    font-size: 17px;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }
  .nav button {
    white-space: nowrap;
    font-size: 11px;
    padding: 9px 10px;
  }
  .nav-icon {
    display: none;
  }
  .main {
    padding: 0 16px 25px;
  }
  .topbar {
    height: 60px;
  }
  .heading {
    padding: 24px 0 20px;
    align-items: center;
  }
  h1 {
    font-size: 26px;
  }
  .heading .muted {
    font-size: 11px;
  }
  .summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 16px;
  }
  .stat-label {
    margin-bottom: 12px;
  }
  .stat-foot {
    display: none;
  }
  .round-grid,
  .grid2 {
    grid-template-columns: 1fr;
  }
  .rate-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filters {
    padding: 13px;
  }
  .filters input,
  .filters select {
    max-width: 100%;
  }
  .filters label {
    flex: 1;
    min-width: 125px;
  }
  .tabs {
    gap: 18px;
    padding: 0 15px;
  }
  .panel-pad {
    padding: 18px;
  }
  .panel-header {
    padding: 17px;
  }
  .title-cell {
    min-width: 190px;
  }
  .login {
    display: block;
  }
  .login-art {
    padding: 28px;
    min-height: 300px;
  }
  .login-art h1 {
    font-size: 34px;
    letter-spacing: -1px;
    margin-top: 30px;
  }
  .login-art p,
  .login-footer {
    display: none;
  }
  .login-form {
    padding: 35px 24px;
  }
  .dialog-content {
    padding: 18px;
  }
  .dialog-head {
    padding: 18px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .user-name {
    display: none;
  }
  #toast {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }
  .heading .primary {
    font-size: 11px;
    padding: 10px;
  }
  .review-content {
    font-size: 12px;
  }
}

.rules-preview img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin: 12px 0;
}
.rules-preview h2,
.rules-preview h3,
.rules-preview h4 {
  margin: 10px 0;
}
.rules-preview code {
  background: #e7eddf;
  padding: 2px 4px;
  border-radius: 3px;
}
