:root {
  --admin-bg: #07111f;
  --admin-panel: rgba(21, 34, 51, 0.86);
  --admin-panel-soft: rgba(29, 43, 62, 0.82);
  --admin-border: rgba(144, 164, 183, 0.15);
  --admin-text: #f5f7fb;
  --admin-muted: #9aaabc;
  --admin-green: #1fe28a;
  --admin-blue: #32aaff;
  --admin-yellow: #ffd528;
  --admin-violet: #9b6cff;
  --admin-red: #ff5b66;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 30% 0%, rgba(19, 82, 116, 0.2), transparent 35%),
    linear-gradient(135deg, #07111f 0%, #0b1524 48%, #0b1725 100%);
  color: var(--admin-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  color: var(--admin-text);
  line-height: 1.12;
  margin-top: 0;
}

p {
  color: var(--admin-muted);
  line-height: 1.55;
}

.page,
.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

.wide-page {
  align-items: flex-start;
}

.hero-card,
.auth-card,
.dashboard-card {
  width: min(100%, 900px);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30, 45, 64, 0.9), rgba(16, 29, 45, 0.92));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  padding: 30px;
}

.wide-card {
  width: min(100%, 1300px);
}

.auth-card {
  max-width: 460px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--admin-green), #0bbdff);
  color: #052019;
  font-size: 24px;
  font-weight: 900;
}

.button-row,
.assignment-actions,
.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row {
  margin: 24px 0;
}

.primary-btn,
.secondary-btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(144, 164, 183, 0.18);
  border-radius: 8px;
  background: rgba(23, 35, 52, 0.92);
  color: #d8e2ee;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
  text-decoration: none;
}

.primary-btn,
button {
  border-color: rgba(31, 226, 138, 0.7);
  background: var(--admin-green);
  color: #061321;
}

.secondary-btn {
  border-color: rgba(31, 226, 138, 0.35);
  color: var(--admin-green);
}

.small-btn {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
}

button:disabled,
.claim-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(144, 164, 183, 0.22);
  border-radius: 8px;
  background: rgba(8, 19, 33, 0.82);
  color: var(--admin-text);
  font: inherit;
  letter-spacing: 0;
  outline: 0;
  padding: 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 226, 138, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 226, 138, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 170, 188, 0.72);
}

option {
  background: #101b2a;
  color: var(--admin-text);
}

input[readonly] {
  background: rgba(255, 255, 255, 0.045);
  color: var(--admin-muted);
}

.feature-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.feature-card,
.tile,
.panel,
.assignment-card,
.checklist-item,
.checklist-summary {
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.feature-card,
.tile,
.panel,
.assignment-card,
.checklist-item,
.checklist-summary {
  padding: 18px;
}

.tile-link {
  color: inherit;
  text-decoration: none;
}

.tile-link .tile {
  min-height: 164px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tile-link .tile:hover {
  border-color: rgba(31, 226, 138, 0.38);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  transform: translateY(-3px);
}

.footer-note,
#message,
.status-message {
  color: var(--admin-green);
  font-weight: 800;
}

#message,
.status-message {
  min-height: 22px;
  margin: 0 0 20px;
}

.status-message.error {
  color: var(--admin-red);
}

.dashboard-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 28px;
  padding-top: 24px;
}

.dashboard-section h2 {
  margin-bottom: 6px;
}

.assignment-list {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.assignment-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.assignment-card h3 {
  margin-bottom: 10px;
}

.assignment-card p {
  margin: 7px 0;
}

.assignment-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.claim-btn {
  background: #0d1f32;
  color: var(--admin-green);
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-open {
  background: rgba(31, 226, 138, 0.13);
  color: var(--admin-green);
}

.status-claimed {
  background: rgba(50, 170, 255, 0.13);
  color: var(--admin-blue);
}

.status-in-progress {
  background: rgba(255, 213, 40, 0.14);
  color: var(--admin-yellow);
}

.status-unknown {
  background: rgba(154, 170, 188, 0.14);
  color: var(--admin-muted);
}

.assignment-map-link {
  background: rgba(13, 31, 50, 0.92);
  border-color: rgba(50, 170, 255, 0.35);
  color: #aee3ff;
}

.start-job-btn {
  background: var(--admin-green);
  color: #061321;
}

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

.contractor-work-panel {
  align-content: start;
  display: grid;
}

.contractor-work-panel .assignment-list {
  max-height: 580px;
  overflow: auto;
  padding-right: 4px;
}

.contractor-hero-panel {
  min-height: auto;
}

.start-job-modal {
  align-items: center;
  background: rgba(3, 9, 17, 0.72);
  backdrop-filter: blur(12px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 100;
}

.start-job-modal[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.start-job-panel {
  background: linear-gradient(145deg, rgba(30, 45, 64, 0.98), rgba(13, 25, 40, 0.98));
  border: 1px solid rgba(144, 164, 183, 0.22);
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  width: min(100%, 680px);
}

.start-job-header,
.start-job-actions,
.start-location-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.start-job-header h2 {
  font-size: 24px;
  margin: 4px 0 0;
}

.start-job-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.start-job-summary div,
.active-job-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  padding: 13px;
}

.start-job-summary span,
.active-job-status span {
  color: var(--admin-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.start-job-summary strong {
  color: var(--admin-text);
  display: block;
  line-height: 1.35;
}

.start-job-summary .span-two {
  grid-column: span 2;
}

.start-job-checklist {
  display: grid;
  gap: 14px;
}

.start-job-checklist label {
  color: #d8e2ee;
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.start-job-confirm {
  align-items: center;
  background: rgba(31, 226, 138, 0.08);
  border: 1px solid rgba(31, 226, 138, 0.2);
  border-radius: 8px;
  grid-template-columns: auto 1fr;
  min-height: 52px;
  padding: 12px;
}

.start-job-confirm input {
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.start-location-row p {
  flex: 1;
  margin: 0;
}

.active-job-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.active-job-status strong {
  color: var(--admin-green);
  display: block;
  font-size: 18px;
}

.active-job-panel ol {
  color: #d8e2ee;
  margin: 0;
  padding-left: 20px;
}

.active-job-panel li + li {
  margin-top: 7px;
}

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

.dashboard-header h1 {
  font-size: 30px;
  margin: 12px 0 6px;
}

.dashboard-header p {
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: flex-start;
}

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

.checklist-builder {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.checklist-item {
  display: grid;
  gap: 12px;
}

.checklist-item-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1.4fr);
}

.recurring-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.checklist-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.checklist-flags label {
  align-items: center;
  color: #d8e2ee;
  display: flex;
  gap: 8px;
}

.remove-checklist-item {
  justify-self: flex-end;
}

.property-card h3 {
  margin-bottom: 6px;
}

.property-card .checklist-summary {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 14px;
  padding-top: 14px;
}

.checklist-summary ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.full-width {
  margin-top: 24px;
}

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

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

  .checklist-item-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page,
  .landing-page {
    padding: 16px;
  }

  .hero-card,
  .auth-card,
  .dashboard-card {
    padding: 22px;
  }

  .dashboard-header h1 {
    font-size: 26px;
  }
}

@media (max-width: 900px) {
  body.admin-command-body .admin-command {
    display: block;
    min-height: 100vh;
  }

  body.admin-command-body .command-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
    padding: 12px;
    gap: 12px;
    background: rgba(6, 16, 29, 0.97);
    backdrop-filter: blur(10px);
  }

  body.admin-command-body .command-brand {
    font-size: 20px;
    letter-spacing: 3px;
  }

  body.admin-command-body .command-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -2px;
    padding: 0 2px 6px;
    scrollbar-width: none;
  }

  body.admin-command-body .command-nav::-webkit-scrollbar,
  body.sales-portal-body .sales-nav::-webkit-scrollbar {
    display: none;
  }

  body.admin-command-body .command-nav p {
    display: none;
  }

  body.admin-command-body .nav-link {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  body.admin-command-body .nav-link.active {
    border-right: 0;
    box-shadow: inset 0 -2px 0 var(--admin-green);
  }

  body.admin-command-body .admin-user-card {
    display: flex;
    width: 100%;
    min-height: 48px;
    margin-top: 0;
    padding: 10px 12px;
  }

  body.admin-command-body .admin-user-card .chevron {
    margin-left: auto;
  }

  body.admin-command-body .command-main {
    padding: 16px 12px 84px;
  }

  body.admin-command-body .command-header,
  body.admin-command-body .command-tools,
  body.admin-command-body .panel-heading {
    gap: 12px;
  }

  body.admin-command-body .command-header h1 {
    font-size: 24px;
  }

  body.admin-command-body .command-header p,
  body.admin-command-body .wip-panel p,
  .assignment-card p {
    font-size: 14px;
  }

  body.admin-command-body .secondary-command-btn,
  body.admin-command-body .new-btn,
  .assignment-actions > a,
  .assignment-actions > button {
    width: 100%;
    min-height: 48px;
  }

  body.admin-command-body .panel-card {
    padding: 14px;
  }

  body.admin-command-body .wip-panel {
    min-height: auto;
    padding: 18px;
  }

  body.admin-command-body .wip-panel h2 {
    font-size: 24px;
  }

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

  body.admin-command-body .pipeline-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  body.admin-command-body .pipeline-column {
    flex: 0 0 min(86vw, 320px);
    scroll-snap-align: start;
  }

  body.admin-command-body .schedule-list div {
    align-items: start;
    grid-template-columns: 10px 58px 1fr;
  }

  body.admin-command-body .schedule-list em {
    grid-column: 3;
    justify-self: start;
  }

  body.admin-command-body .assignments-overview,
  body.admin-command-body .sales-table-wrap {
    overflow-x: auto;
  }

  body.admin-command-body .assignments-overview table {
    min-width: 580px;
  }

  body.admin-command-body .account-request-actions,
  body.admin-command-body .account-request-person,
  body.admin-command-body .qa-content,
  .contractor-work-grid {
    grid-template-columns: 1fr;
  }

  body.admin-command-body .account-request-actions button,
  body.admin-command-body .account-request-actions select {
    width: 100%;
  }

  .assignment-card {
    padding: 14px;
  }

  .assignment-card h3 {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .assignment-card p {
    overflow-wrap: anywhere;
  }

  .assignment-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .contractor-work-panel .assignment-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .start-job-modal {
    align-items: flex-end;
    padding: 0;
  }

  .start-job-panel {
    border-radius: 14px 14px 0 0;
    max-height: 92vh;
    width: 100%;
  }

  .start-job-header,
  .start-job-actions,
  .start-location-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .start-job-summary {
    grid-template-columns: 1fr;
  }

  .start-job-summary .span-two {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  body.sales-portal-body .sales-portal {
    display: block;
  }

  body.sales-portal-body .sales-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    display: grid;
    gap: 12px;
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--sales-line);
    padding: 12px;
    background: rgba(3, 12, 22, 0.97);
    backdrop-filter: blur(10px);
  }

  body.sales-portal-body .sales-brand {
    padding: 0 0 10px;
  }

  body.sales-portal-body .sales-brand strong {
    font-size: 20px;
  }

  body.sales-portal-body .sales-brand span {
    font-size: 10px;
  }

  body.sales-portal-body .sales-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 6px;
    scrollbar-width: none;
  }

  body.sales-portal-body .sales-nav p,
  body.sales-portal-body .sales-collapse-btn,
  body.sales-portal-body .sales-profile-chip,
  body.sales-portal-body .sales-bell {
    display: none;
  }

  body.sales-portal-body .sales-nav-link {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  body.sales-portal-body .sales-user-card {
    min-height: 48px;
  }

  body.sales-portal-body .sales-main {
    padding: 16px 12px 84px;
  }

  body.sales-portal-body .sales-topbar h1 {
    font-size: 23px;
  }

  body.sales-portal-body .sales-top-actions,
  body.sales-portal-body .sales-filter-row,
  body.sales-portal-body .sales-board-toolbar,
  body.sales-portal-body .sales-table-tabs,
  body.sales-portal-body .sales-table-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.sales-portal-body .sales-add-btn,
  body.sales-portal-body .sales-filter-row button,
  body.sales-portal-body .sales-filter-row select,
  body.sales-portal-body .sales-table-tabs button,
  body.sales-portal-body .sales-table-summary button {
    width: 100%;
    min-height: 46px;
    justify-content: center;
  }

  body.sales-portal-body .sales-stats,
  body.sales-portal-body .sales-right-rail,
  body.sales-portal-body .sales-source-content,
  body.sales-portal-body .sales-modal-grid {
    grid-template-columns: 1fr;
  }

  body.sales-portal-body .sales-stat {
    grid-template-columns: 40px 1fr;
    padding: 14px;
  }

  body.sales-portal-body .sales-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }

  body.sales-portal-body .sales-stage-column {
    flex: 0 0 min(84vw, 320px);
    min-width: 0;
    scroll-snap-align: start;
  }

  body.sales-portal-body .sales-team-head {
    display: none;
  }

  body.sales-portal-body .sales-team-row {
    grid-template-columns: 1fr auto;
  }

  body.sales-portal-body .sales-modal {
    padding: 12px;
  }

  body.sales-portal-body .sales-modal-panel {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  body.sales-portal-body .sales-modal-grid .span-two {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  body.public-portal-body .public-shell {
    width: min(calc(100% - 24px), 1480px);
  }

  body.public-portal-body .public-nav {
    min-height: auto;
    padding: 16px 0 12px;
  }

  body.public-portal-body .public-nav-actions,
  body.public-portal-body .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.public-portal-body .public-nav-actions a,
  body.public-portal-body .public-btn,
  body.public-portal-body .portal-choice-card em {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }

  body.public-portal-body .portal-entry-main,
  body.public-portal-body .landing-main,
  body.public-portal-body .signup-layout,
  body.public-portal-body .role-auth-layout {
    padding: 12px 0 28px;
  }

  body.public-portal-body .role-auth-intro {
    min-height: auto;
  }

  body.public-portal-body .role-auth-card,
  body.public-portal-body .signup-card,
  body.public-portal-body .portal-choice-card {
    padding: 18px;
  }

  body.public-portal-body .hero-copy h1,
  body.public-portal-body .signup-intro h1,
  body.public-portal-body .portal-entry-hero h1,
  body.public-portal-body .role-auth-intro h1 {
    font-size: clamp(32px, 10vw, 42px);
    line-height: 1.04;
  }

  body.public-portal-body .portal-choice-card strong {
    font-size: 24px;
  }

  body.public-portal-body .auth-mode-tabs button,
  body.public-portal-body .public-form input,
  body.public-portal-body .public-form select {
    min-height: 48px;
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .page,
  .landing-page {
    align-items: flex-start;
    min-height: auto;
    padding: 12px;
  }

  .hero-card,
  .auth-card,
  .dashboard-card {
    border-radius: 10px;
    padding: 18px;
  }

  .button-row,
  .template-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .secondary-btn,
  .button-row > a,
  .button-row > button {
    width: 100%;
    min-height: 48px;
  }

  .feature-grid,
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  body.admin-command-body .metric-grid {
    grid-template-columns: 1fr;
  }

  body.admin-command-body .command-brand span,
  body.sales-portal-body .sales-brand span,
  body.public-portal-body .public-brand small {
    letter-spacing: 0.08em;
  }

  body.public-portal-body .public-brand strong {
    font-size: 20px;
  }

  body.admin-command-body .avatar,
  body.sales-portal-body .sales-avatar {
    height: 36px;
    width: 36px;
  }
}
