/*
  Atlas Production Overhaul
  Global visual system loaded last so it applies across all pages and roles.
*/

:root {
  --atlas-overhaul-max: 1320px;
  --atlas-overhaul-gutter: clamp(14px, 2.2vw, 28px);
  --atlas-overhaul-radius-sm: 12px;
  --atlas-overhaul-radius-md: 16px;
  --atlas-overhaul-radius-lg: 22px;
  --atlas-overhaul-radius-xl: 28px;

  --atlas-overhaul-bg-top: #04111a;
  --atlas-overhaul-bg-mid: #071725;
  --atlas-overhaul-bg-bottom: #0b1f2d;
  --atlas-overhaul-surface: linear-gradient(180deg, rgba(12, 25, 37, 0.94), rgba(8, 18, 30, 0.92));
  --atlas-overhaul-surface-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  --atlas-overhaul-border: rgba(177, 219, 255, 0.16);
  --atlas-overhaul-border-strong: rgba(118, 195, 255, 0.38);
  --atlas-overhaul-text: rgba(241, 250, 255, 0.96);
  --atlas-overhaul-text-muted: rgba(201, 221, 238, 0.74);
  --atlas-overhaul-text-soft: rgba(188, 207, 224, 0.58);
  --atlas-overhaul-accent: #62c2ff;
  --atlas-overhaul-accent-2: #66e1cc;
  --atlas-overhaul-danger: #ff6f87;
  --atlas-overhaul-success: #45d19d;
  --atlas-overhaul-warning: #f3c46c;

  --atlas-overhaul-shadow-sm: 0 10px 24px rgba(1, 7, 14, 0.34);
  --atlas-overhaul-shadow-md: 0 18px 42px rgba(1, 7, 14, 0.4);
  --atlas-overhaul-shadow-lg: 0 30px 70px rgba(1, 7, 14, 0.46);
}

:root[data-theme="light"] {
  --atlas-overhaul-bg-top: #f3f8fb;
  --atlas-overhaul-bg-mid: #edf3f7;
  --atlas-overhaul-bg-bottom: #e8eff5;
  --atlas-overhaul-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 252, 255, 0.95));
  --atlas-overhaul-surface-soft: linear-gradient(180deg, rgba(15, 31, 48, 0.06), rgba(15, 31, 48, 0.03));
  --atlas-overhaul-border: rgba(15, 31, 48, 0.13);
  --atlas-overhaul-border-strong: rgba(37, 99, 235, 0.42);
  --atlas-overhaul-text: #102233;
  --atlas-overhaul-text-muted: #42586a;
  --atlas-overhaul-text-soft: #5b7080;
  --atlas-overhaul-accent: #1d79d5;
  --atlas-overhaul-accent-2: #14a29d;
  --atlas-overhaul-shadow-sm: 0 8px 20px rgba(15, 31, 48, 0.09);
  --atlas-overhaul-shadow-md: 0 14px 28px rgba(15, 31, 48, 0.12);
  --atlas-overhaul-shadow-lg: 0 24px 46px rgba(15, 31, 48, 0.14);
}

html,
body {
  width: 100%;
}

/* Prevent inherited grid/flex children from forcing horizontal overflow. */
.site-main,
.public,
.dash,
.public-inner,
.page-shell,
.ops-shell,
.section-stack,
.surface-panel,
.card,
.tile-grid,
.action-tile,
.dashboard-grid,
.dashboard-main,
.dashboard-aside {
  min-width: 0;
}

body {
  color: var(--atlas-overhaul-text);
  background:
    radial-gradient(1200px 620px at 8% 8%, rgba(98, 194, 255, 0.14), transparent 58%),
    radial-gradient(960px 560px at 92% 12%, rgba(102, 225, 204, 0.1), transparent 54%),
    linear-gradient(180deg, var(--atlas-overhaul-bg-top), var(--atlas-overhaul-bg-mid) 50%, var(--atlas-overhaul-bg-bottom));
}

.header .container,
.container,
.public-inner,
.breadcrumbs {
  max-width: var(--atlas-overhaul-max);
  padding-inline: var(--atlas-overhaul-gutter);
}

.header {
  background: color-mix(in srgb, var(--atlas-overhaul-bg-top) 84%, transparent);
  border-bottom: 1px solid var(--atlas-overhaul-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.nav {
  height: 74px;
  gap: 10px;
}

.nav-left,
.nav-right {
  gap: 10px;
}

.brand {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--atlas-overhaul-border);
  background: linear-gradient(135deg, rgba(98, 194, 255, 0.2), rgba(102, 225, 204, 0.16));
  box-shadow: var(--atlas-overhaul-shadow-sm);
  color: var(--atlas-overhaul-text);
}

.brand:hover {
  border-color: var(--atlas-overhaul-border-strong);
}

h1,
.page-copy h1,
.page-title h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

h2,
.public-header h2,
.dash-header h2,
.dash-top h2 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3,
h4,
.page-section-title h3 {
  font-weight: 700;
}

p,
.muted,
.panel-copy {
  color: var(--atlas-overhaul-text-muted);
}

.page-kicker,
.stat-card-label,
.field label,
.label {
  color: var(--atlas-overhaul-text-soft);
}

.pill,
.primary-btn,
.secondary-btn,
.ghost-btn,
button.primary-btn,
button.secondary-btn,
button.ghost-btn,
.badge,
.menu-item,
.dd-item,
.application-tab {
  min-height: 44px;
  border-radius: var(--atlas-overhaul-radius-md);
  border: 1px solid var(--atlas-overhaul-border);
  box-shadow: var(--atlas-overhaul-shadow-sm);
  color: var(--atlas-overhaul-text);
  font-weight: 600;
}

.pill {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.primary-btn,
button.primary-btn {
  background: linear-gradient(135deg, color-mix(in srgb, var(--atlas-overhaul-accent) 92%, white), color-mix(in srgb, var(--atlas-overhaul-accent-2) 80%, #4c7cff));
  border-color: color-mix(in srgb, var(--atlas-overhaul-accent) 46%, white);
  color: #06131f;
}

:root[data-theme="light"] .primary-btn,
:root[data-theme="light"] button.primary-btn {
  color: #ffffff;
}

.secondary-btn,
button.secondary-btn,
.ghost-btn,
button.ghost-btn,
.menu-item,
.dd-item {
  background: rgba(255, 255, 255, 0.06);
}

.pill:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.menu-item:hover,
.dd-item:hover,
.application-tab:hover {
  border-color: var(--atlas-overhaul-border-strong);
  transform: translateY(-1px);
}

.card,
.surface-panel,
.panel-card,
.listing-filters,
.table-toolbar,
.command-card,
.queue-card,
.health-card,
.chat-panel,
.jobs-panel,
.application-lane,
.application-card,
.application-bulk-bar,
.manager-dashboard-page .ops-sidebar .card,
.property-manager-dashboard-page .ops-sidebar .card,
.tenant-dashboard .surface-panel {
  border-radius: var(--atlas-overhaul-radius-lg);
  border: 1px solid var(--atlas-overhaul-border);
  background: var(--atlas-overhaul-surface);
  box-shadow: var(--atlas-overhaul-shadow-md);
}

.page-shell,
.section-stack,
.ops-shell,
.tenant-shell,
.messages-shell,
.dashboard-main,
.dashboard-aside {
  gap: 18px;
}

.public,
.dash,
.alerts-page {
  padding-block: 28px 72px;
}

.public-header,
.dash-header,
.dash-top,
.page-hero,
.dashboard-hero {
  margin-bottom: 14px;
}

.table th {
  color: var(--atlas-overhaul-text-soft);
}

.table td {
  color: var(--atlas-overhaul-text);
}

.table tbody tr {
  transition: background 180ms ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

input,
select,
textarea {
  border-radius: var(--atlas-overhaul-radius-sm);
  border: 1px solid var(--atlas-overhaul-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--atlas-overhaul-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--atlas-overhaul-text-soft);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: rgba(16, 34, 51, 0.04);
}

.notice {
  border-radius: var(--atlas-overhaul-radius-md);
  border-color: color-mix(in srgb, var(--atlas-overhaul-accent) 30%, white);
}

.notice.err {
  border-color: color-mix(in srgb, var(--atlas-overhaul-danger) 45%, white);
}

.stat,
.stat-card,
.application-stat-card {
  border-radius: var(--atlas-overhaul-radius-md);
  border: 1px solid var(--atlas-overhaul-border);
  background: var(--atlas-overhaul-surface-soft);
}

.stat-num,
.stat-card-value,
.application-stat-card__value {
  color: var(--atlas-overhaul-text);
}

.action-tile,
.listing-card-modern,
.contractor-directory-card,
.job-card,
.maintenance-request-card {
  border-radius: var(--atlas-overhaul-radius-lg);
  border: 1px solid var(--atlas-overhaul-border);
  background: var(--atlas-overhaul-surface-soft);
}

.application-tabs__nav {
  gap: 10px;
}

.application-tab {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.application-tab.is-active {
  border-color: var(--atlas-overhaul-border-strong);
  background: rgba(98, 194, 255, 0.16);
}

.menu-panel,
.profile-panel,
.dd-menu,
.command-palette-panel {
  border-radius: var(--atlas-overhaul-radius-lg);
  border: 1px solid var(--atlas-overhaul-border);
  background: color-mix(in srgb, var(--atlas-overhaul-bg-top) 92%, transparent);
  box-shadow: var(--atlas-overhaul-shadow-lg);
}

.toast {
  border-radius: var(--atlas-overhaul-radius-md);
  border: 1px solid var(--atlas-overhaul-border);
  background: color-mix(in srgb, var(--atlas-overhaul-bg-top) 92%, transparent);
}

.page-actions,
.hero-actions,
.form-actions,
.form-submit-row,
.listing-card-actions,
.application-card__actions {
  gap: 10px;
}

.page-actions > *,
.hero-actions > *,
.form-actions > *,
.form-submit-row > * {
  min-height: 44px;
}

.listing-curation-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.listing-curation-col {
  display: grid;
  gap: 8px;
  border: 1px solid var(--atlas-overhaul-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.listing-curation-col h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.16;
}

.listing-curation-col p {
  margin: 0;
  color: var(--atlas-overhaul-text-soft);
}

.listing-card-media {
  position: relative;
}

.listing-pick-tag,
.listing-mood-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.listing-pick-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  border: 1px solid rgba(127, 240, 208, 0.42);
  background: rgba(127, 240, 208, 0.16);
  color: rgba(215, 255, 245, 0.95);
}

.listing-curation-meta {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.listing-mood-tag {
  width: fit-content;
  border: 1px solid rgba(118, 195, 255, 0.42);
  background: rgba(118, 195, 255, 0.16);
  color: rgba(226, 246, 255, 0.96);
}

.listing-curation-copy {
  font-size: 12px;
  color: var(--atlas-overhaul-text-soft);
}

@media (max-width: 1200px) {
  .header .container,
  .container,
  .public-inner,
  .breadcrumbs {
    padding-inline: clamp(14px, 2.1vw, 20px);
  }

  .nav .nav-actions,
  .nav .nav-actions.desktop-only {
    display: none !important;
  }

  .nav .menu-wrap {
    display: block !important;
  }

  /* Keep the closed drawer out of layout flow to avoid mobile clipping. */
  .menu-panel {
    display: none !important;
  }

  .menu-panel.open {
    display: block !important;
  }

  .listing-curation-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header .container,
  .container,
  .public-inner,
  .breadcrumbs {
    padding-inline: 14px;
  }

  .nav {
    height: 70px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .brand {
    max-width: 55vw;
    font-size: 18px;
    padding-inline: 12px;
  }

  .nav .profile,
  .nav .dropdown,
  .nav .profile-btn,
  .nav .dd-trigger,
  .nav .profile-panel,
  .nav .dd-menu {
    display: none !important;
  }

  .menu-panel {
    top: 70px;
    width: min(94vw, 360px);
    border-radius: 20px 0 0 0;
    display: none !important;
  }

  .menu-panel.open {
    display: block !important;
  }

  .public-inner,
  .page-shell,
  .section-stack,
  .surface-panel,
  .tile-grid,
  .ops-shell,
  .dashboard-grid {
    width: 100%;
    max-width: 100%;
  }

  .ops-shell,
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ops-sidebar,
  .section-stack,
  .surface-panel,
  .tile-grid,
  .action-tile {
    min-width: 0;
  }

  .ops-shell > *,
  .dashboard-grid > * {
    min-width: 0;
  }

  .panel-copy,
  .action-tile-copy,
  .muted,
  .public p {
    overflow-wrap: anywhere;
  }

  .public,
  .dash,
  .alerts-page {
    padding-block: 22px 66px;
  }

  .page-shell,
  .section-stack,
  .ops-shell,
  .tenant-shell,
  .messages-shell {
    gap: 14px;
  }

  .page-actions,
  .hero-actions,
  .form-actions,
  .form-submit-row {
    width: 100%;
  }

  .page-actions > *,
  .hero-actions > *,
  .form-actions > *,
  .form-submit-row > * {
    width: 100%;
  }

  h1,
  .page-copy h1,
  .page-title h1 {
    font-size: clamp(28px, 7.2vw, 36px);
  }

  h2,
  .public-header h2,
  .dash-header h2,
  .dash-top h2 {
    font-size: clamp(22px, 5.4vw, 28px);
  }
}

/* Queue customization + text-button navigation polish */
.today-queue-panel{
  display:grid;
  gap:12px;
}
.today-queue-list{
  display:grid;
  gap:10px;
}
.today-queue-list.is-drag-over{
  outline:2px dashed var(--atlas-overhaul-border-strong);
  outline-offset:4px;
  border-radius:14px;
}
.today-queue-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:42px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  box-shadow:none;
  text-decoration:none;
  color:var(--atlas-overhaul-text);
}
.today-queue-item:hover{
  border-color:var(--atlas-overhaul-border);
  background:rgba(255,255,255,.06);
}
.today-queue-item__label{
  font-weight:600;
}
.today-queue-item__right{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.today-queue-remove{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:40px !important;
  min-width:62px;
  height:40px;
  line-height:1;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--atlas-overhaul-text-soft);
  padding:0 8px;
  border-radius:8px;
  border:1px solid transparent;
  box-sizing:border-box;
}
.today-queue-remove:hover,
.today-queue-remove:focus-visible{
  border-color:var(--atlas-overhaul-border);
  background:rgba(255,255,255,.12);
  color:var(--atlas-overhaul-text);
}

.menu-panel .menu-item,
.profile-panel .dd-item,
.dd-menu .dd-item{
  min-height:0;
  padding:8px 10px;
  border:1px solid transparent !important;
  border-radius:10px;
  background:transparent !important;
  box-shadow:none !important;
  font-weight:500;
}
.menu-panel .menu-item:hover,
.profile-panel .dd-item:hover,
.dd-menu .dd-item:hover{
  background:rgba(255,255,255,.08) !important;
  border-color:var(--atlas-overhaul-border) !important;
  transform:none;
}
.menu-panel .menu-item:active,
.profile-panel .dd-item:active,
.dd-menu .dd-item:active{
  background:rgba(255,255,255,.13) !important;
  border-color:var(--atlas-overhaul-border-strong) !important;
  transform:scale(.985);
}

/* Applications styling closer to property checks table language */
.manager-applications-page .application-lane{
  border-radius:18px;
  background:var(--atlas-overhaul-surface);
}
.manager-applications-page .application-card{
  border-radius:14px;
  background:rgba(255,255,255,.035);
  border-color:var(--atlas-overhaul-border);
  box-shadow:var(--atlas-overhaul-shadow-sm);
}
.manager-applications-page .application-card__meta{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* Contractor directory modernization */
.contractor-directory-panel{
  display:grid;
  gap:12px;
}
.contractor-directory-toolbar{
  align-items:end;
}
.contractor-directory-grid--modern{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:14px;
}
.contractor-directory-card--row{
  display:grid;
  grid-template-columns:96px minmax(0,1fr) auto;
  gap:14px;
  align-items:start;
}
.contractor-directory-photo-wrap{
  width:96px;
  height:96px;
}
.contractor-directory-photo-link{
  display:block;
  width:100%;
  height:100%;
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--atlas-overhaul-border);
  background:rgba(255,255,255,.05);
}
.contractor-directory-photo{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center center;
  display:block;
}
.contractor-directory-primary{
  display:grid;
  gap:8px;
}
.contractor-directory-title{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.contractor-directory-title h4{
  margin:0;
}
.contractor-directory-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.contractor-directory-tag{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--atlas-overhaul-border);
  background:rgba(255,255,255,.05);
  font-size:11px;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--atlas-overhaul-text-soft);
}
.contractor-directory-metrics{
  min-width:136px;
  display:grid;
  gap:6px;
  justify-items:end;
}
.contractor-directory-actions{
  display:flex;
  justify-content:flex-end;
}

/* Profile suite unification */
.profile-account-suite{
  display:grid;
  gap:14px;
}
.profile-grid--suite{
  margin-top:0;
}
.profile-photo-card--embedded,
.profile-form-card{
  min-width:0;
}

/* Light mode readability polish */
:root[data-theme="light"] .muted,
:root[data-theme="light"] .panel-copy,
:root[data-theme="light"] .page-kicker,
:root[data-theme="light"] .today-queue-remove,
:root[data-theme="light"] .application-stack-hint{
  color:#355166;
}
:root[data-theme="light"] .table th,
:root[data-theme="light"] .table td,
:root[data-theme="light"] .application-card,
:root[data-theme="light"] .application-lane,
:root[data-theme="light"] .menu-item,
:root[data-theme="light"] .dd-item,
:root[data-theme="light"] .today-queue-item,
:root[data-theme="light"] .contractor-directory-card{
  color:#0f2435;
}
:root[data-theme="light"] .application-lane,
:root[data-theme="light"] .application-card,
:root[data-theme="light"] .today-queue-item:hover,
:root[data-theme="light"] .menu-panel .menu-item:hover,
:root[data-theme="light"] .profile-panel .dd-item:hover,
:root[data-theme="light"] .dd-menu .dd-item:hover{
  background:rgba(15,23,42,.05) !important;
}

@media (max-width: 980px){
  .contractor-directory-card--row{
    grid-template-columns:1fr;
  }
  .contractor-directory-photo-wrap{
    width:84px;
    height:84px;
  }
  .contractor-directory-metrics{
    justify-items:start;
  }
  .contractor-directory-actions{
    justify-content:flex-start;
  }
}

@media (max-width: 760px){
  .site-main,
  .public,
  .public-inner,
  .page-shell,
  .tenant-shell,
  .dashboard-grid,
  .dashboard-main,
  .dashboard-aside,
  .ops-shell,
  .section-stack,
  .surface-panel,
  .card{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:clip;
  }
  .today-queue-item{
    padding:10px;
  }
}

.ops-nav-link{
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  box-shadow:none;
}
.ops-nav-link:hover,
.ops-nav-link.active{
  background:rgba(255,255,255,.08);
  border-color:var(--atlas-overhaul-border);
}
.ops-nav-head{
  border:1px solid transparent;
}
.ops-nav-head:hover{
  border-color:var(--atlas-overhaul-border);
}


/* Contractor directory (modern card stack) */
.contractor-directory-grid--modern{
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
}

.tenant-maintenance-submit-btn{
  min-height:44px;
}
.contractor-directory-card--sleek{
  display:grid;
  gap:12px;
  padding:14px;
  border-radius:18px;
}
.contractor-directory-card--sleek .contractor-directory-photo-wrap{
  width:100%;
  height:auto;
}
.contractor-directory-card--sleek .contractor-directory-photo-link{
  width:100%;
  aspect-ratio:1/1;
}
.contractor-directory-profile-summary{
  display:grid;
  gap:8px;
}
.contractor-directory-profession{
  font-size:13px;
  font-weight:700;
  color:var(--atlas-text-soft);
}
.contractor-directory-rating{
  display:grid;
  gap:8px;
}
.contractor-directory-rating__track{
  height:9px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  overflow:hidden;
}
.contractor-directory-rating__track span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#f35f6d,#f1c857,#3fd182);
}
.contractor-directory-rating__meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
}
.contractor-directory-profile-link{width:100%}
