:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8deea;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #15803d;
  --warning: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
}

.setup-layout {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

.status-pill {
  white-space: nowrap;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

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

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid #dbeafe;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

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

.secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-button:hover {
  background: #f8fafc;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.success {
  color: var(--success);
}

.setup-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.list-panel {
  min-width: 0;
}

.rab-list {
  display: grid;
  gap: 12px;
}

.rab-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.rab-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rab-title {
  margin: 0 0 5px;
  font-size: 17px;
}

.rab-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.amount {
  font-size: 16px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
}

.badge.REJECTED {
  background: #fef2f2;
  color: var(--danger);
}

.badge.CLOSED,
.badge.PAID {
  background: #f0fdf4;
  color: var(--success);
}

.badge.APPROVED {
  background: #fffbeb;
  color: var(--warning);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button {
  min-height: 36px;
  padding: 0 12px;
}

.actions .secondary-button {
  background: #ffffff;
  color: var(--ink);
}

.rab-detail {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.attachment-list,
.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.attachment-list li,
.log-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.attachment-list a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.attachment-list a:hover {
  text-decoration: underline;
}

.log-list strong {
  color: var(--ink);
}

.log-list small {
  color: var(--muted);
  line-height: 1.4;
}

.reject-button {
  background: var(--danger);
}

.reject-button:hover {
  background: #b91c1c;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.closed-section {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.closed-toggle {
  width: 100%;
}

.closed-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .layout,
  .setup-layout {
    width: min(100% - 20px, 1180px);
    padding: 20px 0;
  }

  .panel {
    padding: 16px;
  }

  .panel-header,
  .rab-card-header {
    flex-direction: column;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .status-pill {
    white-space: normal;
  }
}
