:root {
  --ink: #080808;
  --muted: #66615c;
  --paper: #f6f4f1;
  --surface: #ffffff;
  --line: #dedbd6;
  --accent: #e16e11;
  --accent-dark: #b84f00;
  --success: #19764b;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(8, 8, 8, 0.1);
  --font: "thmanyah Sans", "Thmanyah Sans", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(225, 110, 17, 0.13), transparent 28%),
    var(--paper);
  font-family: var(--font);
  line-height: 1.7;
}

a {
  color: inherit;
}

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

button,
.button {
  cursor: pointer;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 42px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.portal-brand img {
  width: 58px;
  height: 48px;
  padding: 6px;
  border-radius: 5px;
  background: var(--ink);
  object-fit: contain;
}

.portal-brand strong,
.portal-brand small {
  display: block;
  line-height: 1.15;
}

.portal-brand small {
  color: var(--muted);
  direction: ltr;
}

.back-link {
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
}

.portal-main {
  width: min(100% - 36px, 1120px);
  margin: 0 auto;
  padding: 20px 0 64px;
}

.portal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 64px);
  border-right: 8px solid var(--accent);
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.portal-hero::after {
  position: absolute;
  top: -50px;
  left: -40px;
  width: 180px;
  height: 180px;
  border: 28px solid rgba(225, 110, 17, 0.33);
  border-radius: 50%;
  content: "";
}

.portal-hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 800;
}

.portal-hero h1 {
  max-width: 780px;
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 1.05;
}

.portal-hero p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: #ddd;
  font-size: 1.08rem;
}

.form-shell,
.admin-shell,
.login-card {
  margin-top: 22px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 800;
}

.field label span {
  color: var(--accent);
}

.field small {
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #c9c5bf;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225, 110, 17, 0.13);
}

.honeypot {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-actions,
.admin-actions,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions {
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--accent);
}

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

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

.button.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.form-status {
  display: none;
  margin-top: 20px;
  padding: 15px 18px;
  border-radius: 4px;
  font-weight: 800;
}

.form-status.visible {
  display: block;
}

.form-status.success {
  color: var(--success);
  background: #e9f7ef;
}

.form-status.error {
  color: var(--danger);
  background: #fff0ee;
}

.request-code {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 110px);
  place-items: center;
}

.login-card {
  width: min(100%, 470px);
  margin-top: 0;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.login-card > p {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-card .field + .field {
  margin-top: 15px;
}

.login-card .button {
  width: 100%;
  margin-top: 20px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.admin-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.admin-tabs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.admin-tabs a.active,
.admin-tabs a:hover,
.admin-tabs a:focus-visible {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

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

.admin-summary article {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(8, 8, 8, 0.05);
}

.admin-summary span,
.admin-summary strong {
  display: block;
}

.admin-summary span {
  color: var(--muted);
  font-weight: 800;
}

.admin-summary strong {
  margin-top: 8px;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

.toolbar {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbfaf8;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.toolbar select {
  min-height: 46px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

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

.request-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  color: inherit;
  background: #fff;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    transform 180ms ease;
}

.request-row:hover,
.request-row:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.request-row strong,
.request-row span {
  display: block;
}

.request-row small {
  color: var(--muted);
}

.status {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  color: #5f3b00;
  background: #fff0d9;
  font-size: 0.84rem;
  font-weight: 800;
}

.empty-state {
  padding: 50px 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-item {
  min-height: 100px;
  padding: 16px;
  background: #fff;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.detail-item p {
  margin: 0;
  white-space: pre-wrap;
}

.status-editor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-editor select {
  min-height: 50px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.content-manager h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

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

.admin-divider {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.content-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(220px, 1fr) minmax(100px, 0.25fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.content-row.work-editor {
  grid-template-columns: minmax(100px, 0.28fr) minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(130px, 0.5fr) minmax(90px, 0.22fr) auto;
}

.switch-line {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.switch-line input {
  width: 20px;
  height: 20px;
}

.small-field input {
  text-align: center;
}

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

.row-actions .button {
  min-height: 44px;
  padding-inline: 14px;
}

@media (max-width: 760px) {
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .compact-grid,
  .content-row,
  .content-row.work-editor {
    grid-template-columns: 1fr;
  }

  .field.full,
  .detail-item.full {
    grid-column: auto;
  }

  .request-row {
    grid-template-columns: 1fr 1fr;
  }

  .portal-header,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 500px) {
  .portal-main {
    width: min(100% - 24px, 1120px);
  }

  .portal-header {
    padding-inline: 14px;
  }

  .portal-brand img {
    width: 50px;
    height: 42px;
  }

  .portal-hero,
  .form-shell,
  .admin-shell,
  .login-card {
    padding: 20px;
  }

  .portal-hero h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .request-row {
    grid-template-columns: 1fr;
  }

  .admin-summary {
    gap: 8px;
  }

  .admin-summary article {
    min-height: 104px;
    padding: 14px;
  }

  .toolbar,
  .form-actions,
  .status-editor {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .toolbar label,
  .toolbar select,
  .admin-tabs a,
  .row-actions,
  .row-actions .button,
  .status-editor select {
    width: 100%;
  }
}

/* Admin/private portal refresh. Keeps the same colors and font, improves clarity. */
:root {
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --soft-shadow: 0 18px 56px rgba(8, 8, 8, 0.08);
  --lift-shadow: 0 26px 70px rgba(8, 8, 8, 0.13);
}

body {
  background:
    radial-gradient(circle at 10% 6%, rgba(225, 110, 17, 0.15), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(8, 8, 8, 0.08), transparent 28rem),
    linear-gradient(180deg, #fff 0%, var(--paper) 58%, #f0ece7 100%);
}

.portal-header {
  width: min(100% - 36px, 1180px);
  margin-top: 14px;
  border: 1px solid rgba(8, 8, 8, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(8, 8, 8, 0.06);
  backdrop-filter: blur(14px);
}

.portal-brand img,
.button,
.field input,
.field select,
.field textarea,
.toolbar,
.toolbar select,
.status-editor select,
.admin-tabs a,
.form-status {
  border-radius: var(--radius-sm);
}

.portal-hero,
.form-shell,
.admin-shell,
.login-card,
.admin-summary article,
.request-row,
.content-row,
.detail-grid {
  border-radius: var(--radius-lg);
}

.portal-hero {
  border-right: 0;
  background:
    radial-gradient(circle at 10% 18%, rgba(225, 110, 17, 0.38), transparent 18rem),
    linear-gradient(135deg, #080808 0%, #161616 72%, #2a1608 100%);
}

.form-shell,
.admin-shell,
.login-card {
  border-color: rgba(8, 8, 8, 0.08);
  box-shadow: var(--soft-shadow);
}

.button {
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.button.accent {
  box-shadow: 0 14px 30px rgba(225, 110, 17, 0.24);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.field input,
.field select,
.field textarea,
.toolbar select,
.status-editor select {
  border-color: rgba(8, 8, 8, 0.14);
}

.admin-tabs a.active,
.admin-tabs a:hover,
.admin-tabs a:focus-visible {
  box-shadow: 0 14px 32px rgba(8, 8, 8, 0.18);
}

.admin-summary article,
.request-row,
.content-row {
  border-color: rgba(8, 8, 8, 0.08);
  box-shadow: 0 14px 38px rgba(8, 8, 8, 0.06);
}

.request-row:hover,
.request-row:focus-visible,
.content-row:focus-within {
  box-shadow: var(--lift-shadow);
}

.status {
  border: 1px solid rgba(225, 110, 17, 0.24);
}

.detail-grid {
  border-color: rgba(8, 8, 8, 0.08);
}

@media (max-width: 760px) {
  .portal-header {
    width: min(100% - 24px, 1180px);
    border-radius: var(--radius-md);
  }
}
