.adminShell,
.adminLoginLayout {
  --admin-bg: #f4f3ed;
  --admin-panel: #fffef9;
  --admin-ink: #111411;
  --admin-muted: #6d706a;
  --admin-line: #d9d9d1;
  --admin-green: #b7f529;
  --admin-dark: #101310;
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.adminShell * {
  box-sizing: border-box;
}

.adminSidebar {
  width: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 30px 22px 24px;
  background: var(--admin-dark);
  color: #f0efe9;
}

.adminBrand {
  display: inline-flex;
  align-items: baseline;
  color: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.adminBrand > span {
  color: var(--admin-green);
}

.adminBrand small {
  margin-left: 9px;
  color: #7d8279;
  font: 700 0.58rem/1 "Courier New", monospace;
  letter-spacing: 0.14em;
}

.adminSidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 64px;
}

.adminSidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #b9bcb4;
  font-size: 0.82rem;
  font-weight: 700;
}

.adminSidebar nav a:hover {
  border-color: rgba(183, 245, 41, 0.32);
  color: var(--admin-green);
}

.adminSidebar nav a span {
  width: 20px;
  color: var(--admin-green);
  text-align: center;
}

.adminSidebarFooter {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.adminUserBadge {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.adminUserBadge strong {
  font-size: 0.82rem;
}

.adminUserBadge span {
  overflow: hidden;
  color: #797e75;
  font: 0.66rem/1.2 "Courier New", monospace;
  text-overflow: ellipsis;
}

.adminTextButton {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ca097;
  cursor: pointer;
  font: 700 0.68rem/1.2 "Courier New", monospace;
  text-transform: uppercase;
}

.adminTextButton:hover {
  color: var(--admin-green);
}

.adminTextButton.danger {
  color: #b84a3d;
}

.adminMain {
  min-height: 100vh;
  margin-left: 250px;
  padding: 52px clamp(28px, 5vw, 72px) 90px;
}

.adminPageHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 42px;
}

.adminPageHeader h1,
.adminLoginCard h1 {
  margin: 0 0 12px;
  color: var(--admin-ink);
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.adminPageHeader > div > p:last-child,
.adminLoginLead {
  max-width: 620px;
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.adminKicker {
  margin: 0 0 18px;
  color: #668d0d;
  font: 700 0.68rem/1.2 "Courier New", monospace;
  letter-spacing: 0.12em;
}

.adminPrimaryButton,
.adminSecondaryButton {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 22px;
  border: 1px solid var(--admin-dark);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.adminPrimaryButton {
  background: var(--admin-dark);
  color: var(--admin-green);
}

.adminPrimaryButton:hover {
  background: #252a25;
}

.adminPrimaryButton.compact,
.adminSecondaryButton {
  min-height: 44px;
}

.adminSecondaryButton {
  border-color: var(--admin-line);
  background: transparent;
  color: var(--admin-ink);
}

.adminSecondaryButton:hover {
  border-color: var(--admin-dark);
}

.adminStats {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  margin-bottom: 24px;
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  background: var(--admin-panel);
}

.adminStat {
  min-height: 94px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-right: 1px solid var(--admin-line);
  color: var(--admin-ink);
}

.adminStat:last-child {
  border-right: 0;
}

.adminStat span {
  color: var(--admin-muted);
  font: 700 0.61rem/1.2 "Courier New", monospace;
  text-transform: uppercase;
}

.adminStat strong {
  font-size: 1.75rem;
  letter-spacing: -0.06em;
}

.adminStat.active,
.adminStat:hover {
  background: var(--admin-green);
}

.adminStat.active span,
.adminStat:hover span {
  color: #34420e;
}

.adminFilters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto;
  gap: 10px;
  margin-bottom: 24px;
}

.adminFilters input,
.adminFilters select,
.adminForm input,
.adminForm select,
.adminForm textarea {
  width: 100%;
  border: 1px solid var(--admin-line);
  border-radius: 0;
  outline: 0;
  background: var(--admin-panel);
  color: var(--admin-ink);
  font: 0.88rem/1.4 Arial, Helvetica, sans-serif;
}

.adminFilters input,
.adminFilters select {
  min-height: 44px;
  padding: 0 14px;
}

.adminFilters input:focus,
.adminFilters select:focus,
.adminForm input:focus,
.adminForm select:focus,
.adminForm textarea:focus {
  border-color: #779f19;
  box-shadow: 0 0 0 3px rgba(183, 245, 41, 0.24);
}

.adminTableWrap {
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  background: var(--admin-panel);
}

.adminTable {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.adminTable th {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--admin-line);
  color: #878a84;
  font: 700 0.6rem/1 "Courier New", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adminTable td {
  min-width: 145px;
  padding: 17px 16px;
  border-bottom: 1px solid #e8e7df;
  vertical-align: middle;
  font-size: 0.8rem;
}

.adminTable tr:last-child td {
  border-bottom: 0;
}

.adminTable tbody tr:hover {
  background: #f7f8ee;
}

.adminTable td > strong,
.adminTable td > span,
.adminTable td > a:not(.rowArrow) {
  display: block;
}

.adminTable td > span,
.adminTable td > strong + span,
.adminTable .businessName + span {
  margin-top: 6px;
  color: var(--admin-muted);
  font-size: 0.7rem;
}

.businessName {
  color: var(--admin-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.businessName:hover,
.demoLink:hover {
  color: #5e820c;
}

.demoLink {
  color: #506f0d;
  font-weight: 700;
}

.rowArrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--admin-line);
  color: var(--admin-ink);
}

.rowArrow:hover {
  border-color: var(--admin-dark);
  background: var(--admin-dark);
  color: var(--admin-green);
}

.statusPill {
  width: fit-content;
  padding: 6px 8px;
  border: 1px solid #ccd2bb;
  background: #f4f7ea;
  color: #526018 !important;
  font: 700 0.61rem/1 "Courier New", monospace !important;
  text-transform: uppercase;
}

.statusPill.working {
  border-color: #d4c474;
  background: #fff8d8;
  color: #796810 !important;
}

.statusPill.done {
  border-color: #9dc65a;
  background: #efffd2;
  color: #3c6611 !important;
}

.statusPill.sold {
  border-color: var(--admin-dark);
  background: var(--admin-dark);
  color: var(--admin-green) !important;
}

.statusPill.muted {
  border-color: #d4d4cf;
  background: #ededeb;
  color: #777 !important;
}

.overdue {
  color: #b33a2d !important;
}

.adminEmpty {
  padding: 90px 24px;
  border: 1px dashed #bfc1b7;
  background: rgba(255, 255, 255, 0.42);
  text-align: center;
}

.adminEmpty > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  background: var(--admin-green);
  font-size: 1.5rem;
}

.adminEmpty h2 {
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.adminEmpty p {
  margin-bottom: 26px;
  color: var(--admin-muted);
}

.adminAlert {
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid;
  font-size: 0.8rem;
  font-weight: 700;
}

.adminAlert.success {
  border-color: #9dc65a;
  background: #efffd2;
  color: #3c6611;
}

.adminAlert.error {
  border-color: #db9d95;
  background: #fff0ed;
  color: #932d22;
}

.adminBack {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--admin-muted);
  font: 700 0.65rem/1 "Courier New", monospace;
  text-transform: uppercase;
}

.adminBack:hover {
  color: #55760c;
}

.businessForm,
.adminFormSection.standalone {
  max-width: 1120px;
}

.adminFormSection {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding: 38px 0;
  border-top: 1px solid var(--admin-line);
}

.adminFormSection.standalone {
  margin-top: 52px;
}

.formSectionTitle {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-content: start;
}

.formSectionTitle > span {
  color: #779f19;
  font: 700 0.65rem/1.2 "Courier New", monospace;
}

.formSectionTitle h2 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}

.formSectionTitle p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

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

.adminForm label {
  display: grid;
  gap: 8px;
  align-content: start;
}

.adminForm label > span {
  color: #51554f;
  font: 700 0.65rem/1.2 "Courier New", monospace;
  text-transform: uppercase;
}

.adminForm label.wide {
  grid-column: 1 / -1;
}

.adminForm input,
.adminForm select {
  min-height: 47px;
  padding: 0 13px;
}

.adminForm textarea {
  min-height: 100px;
  padding: 12px 13px;
  resize: vertical;
}

.adminFormActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid var(--admin-line);
}

.uploadBox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px dashed #afb2a7;
  background: var(--admin-panel);
}

.uploadBox input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.uploadBox label {
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.uploadBox label strong {
  font-size: 0.82rem;
}

.uploadBox label span {
  color: var(--admin-muted);
  font: 0.65rem/1.2 "Courier New", monospace;
}

.attachmentList {
  grid-column: 2;
  margin-top: -22px;
  border: 1px solid var(--admin-line);
  border-bottom: 0;
  background: var(--admin-panel);
}

.attachmentRow {
  min-height: 67px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid var(--admin-line);
}

.fileIcon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #e9ebdf;
  color: #5f791e;
  font: 800 0.56rem/1 "Courier New", monospace;
}

.attachmentRow > div:nth-child(2) {
  min-width: 0;
}

.attachmentRow a {
  display: block;
  overflow: hidden;
  color: var(--admin-ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachmentRow a:hover {
  color: #5b7e0c;
}

.attachmentRow span {
  display: block;
  margin-top: 5px;
  color: var(--admin-muted);
  font: 0.6rem/1.2 "Courier New", monospace;
}

.eventTimeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.eventTimeline li {
  min-height: 64px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  position: relative;
}

.eventTimeline li:not(:last-child)::before {
  content: "";
  width: 1px;
  position: absolute;
  top: 14px;
  bottom: -3px;
  left: 5px;
  background: var(--admin-line);
}

.eventDot {
  width: 11px;
  height: 11px;
  margin-top: 2px;
  border: 3px solid var(--admin-bg);
  outline: 1px solid #6e921b;
  background: var(--admin-green);
  border-radius: 50%;
  z-index: 1;
}

.eventTimeline strong,
.eventTimeline span:not(.eventDot) {
  display: block;
}

.eventTimeline strong {
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.eventTimeline span:not(.eventDot) {
  color: var(--admin-muted);
  font: 0.6rem/1.2 "Courier New", monospace;
}

.adminLoginLayout {
  display: grid;
  place-items: center;
  padding: 30px 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--admin-dark);
  background-size: 72px 72px;
}

.adminLoginCard {
  width: min(100%, 500px);
  padding: clamp(30px, 6vw, 56px);
  border-top: 5px solid var(--admin-green);
  background: var(--admin-panel);
  box-shadow: 20px 20px 0 rgba(183, 245, 41, 0.08);
}

.loginBrand {
  margin-bottom: 60px;
  color: var(--admin-ink);
}

.adminLoginCard h1 {
  font-size: clamp(2.6rem, 8vw, 4rem);
}

.adminLoginLead {
  margin-bottom: 32px;
}

.adminLoginForm {
  display: grid;
  gap: 20px;
}

.adminLoginForm .adminPrimaryButton {
  width: 100%;
  margin-top: 8px;
}

.passwordCard .loginBrand {
  margin-bottom: 42px;
}

.srOnly {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .adminSidebar {
    width: 76px;
    padding-inline: 14px;
  }

  .adminSidebar .adminBrand small,
  .adminSidebar nav a:not(:hover) {
    font-size: 0;
  }

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

  .adminSidebar nav a span {
    font-size: 1rem;
  }

  .adminUserBadge,
  .adminSidebarFooter .adminTextButton {
    display: none;
  }

  .adminMain {
    margin-left: 76px;
  }

  .adminFormSection {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .attachmentList {
    grid-column: 1;
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  .adminSidebar {
    width: 100%;
    min-height: 64px;
    height: 64px;
    flex-direction: row;
    align-items: center;
    z-index: 10;
  }

  .adminSidebar nav {
    display: flex;
    margin: 0 0 0 auto;
  }

  .adminSidebar nav a {
    width: 42px;
    min-height: 40px;
  }

  .adminSidebarFooter {
    display: none;
  }

  .adminMain {
    margin-left: 0;
    padding: 96px 16px 60px;
  }

  .adminPageHeader {
    align-items: start;
    flex-direction: column;
  }

  .adminPageHeader .adminPrimaryButton,
  .detailHeader .adminSecondaryButton {
    width: 100%;
  }

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

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

  .adminForm label.wide {
    grid-column: auto;
  }

  .adminFormActions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .attachmentRow {
    grid-template-columns: 42px 1fr;
  }

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