:root {
  --bg: #f6fafb;
  --surface: #ffffff;
  --surface-strong: #eef7f8;
  --text: #102a43;
  --muted: #5b6b7a;
  --border: #dbe8ee;
  --primary: #1267b1;
  --primary-dark: #0b416e;
  --secondary: #0f8a7c;
  --green: #2f9e6e;
  --danger: #b42318;
  --warning: #946200;
  --shadow: 0 14px 34px rgba(16, 42, 67, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
}

.login-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 850;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 14px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.03;
  letter-spacing: 0;
}

.hero-copy p,
.login-note,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy p {
  margin-top: 18px;
  max-width: 610px;
  font-size: 19px;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 32px;
}

.login-card {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.field label {
  font-size: 14px;
  font-weight: 800;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus,
button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 103, 177, 0.16);
  outline: none;
}

.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 850;
}

.button.secondary {
  background: var(--secondary);
}

.button.outline {
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--border);
}

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

.button:active {
  transform: translateY(1px);
}

.login-note {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface-strong);
  border-radius: 8px;
  font-size: 14px;
}

.error {
  display: none;
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #ffd8d3;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

.error.visible {
  display: block;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav button.active,
.nav button:hover {
  color: var(--primary-dark);
  background: var(--surface-strong);
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.topbar h1 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.18;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.panel-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters .input {
  min-width: 260px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  background: #fbfdfe;
}

td {
  font-size: 14px;
}

.partner-name {
  font-weight: 900;
  color: var(--text);
}

.partner-sub {
  margin-top: 4px;
  color: var(--muted);
  white-space: normal;
  max-width: 360px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--primary-dark);
  background: var(--surface-strong);
}

.badge.green {
  color: #145a3c;
  background: #e8f6ef;
}

.badge.gray {
  color: var(--muted);
  background: #eef2f4;
}

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

.small-button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 11px;
  background: #ffffff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
}

.request-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.request {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.request h3 {
  font-size: 17px;
}

.request p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 42, 67, 0.42);
}

.modal-backdrop.visible {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(16, 42, 67, 0.24);
}

.modal-head {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-body {
  padding: 18px;
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .login-shell,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 28px;
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 20px;
  }

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

@media (max-width: 620px) {
  .main,
  .login-panel {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .filters .input,
  .filters .select {
    width: 100%;
    min-width: 0;
  }
}
