.admin-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.auth-loading .login-layout,
.auth-loading .dashboard-view,
.auth-loading .auth-section {
  display: none !important;
}

.admin-topbar,
.admin-card,
.login-card,
.admin-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
}

.admin-brand,
.admin-nav,
.card-heading,
.user-main,
.project-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand img {
  width: 48px;
  height: 48px;
}

.admin-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #183b6b;
  background: #eef4ff;
}

.admin-message.error {
  color: #8a1f17;
  background: #fff1f0;
  border-color: #ffd0cc;
}

.login-layout {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
}

.register-layout {
  min-height: 62vh;
  display: grid;
  place-items: start center;
  padding-top: 18px;
}

.register-card {
  width: min(820px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card label,
.register-card label,
.admin-form {
  display: grid;
  gap: 8px;
}

.register-grid,
.membership-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.register-company {
  grid-column: 1 / -1;
}

.register-card input,
.register-card select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.membership-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.trial-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #b8e9ff;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(127, 220, 255, 0.18), rgba(255, 255, 255, 0.92));
}

.membership-cards article {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.membership-cards span,
.register-card label > span,
.trial-summary span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.membership-cards strong,
.trial-summary strong {
  font-size: 18px;
}

.membership-cards p,
.trial-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-alt-link {
  justify-self: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-alt-link:hover {
  text-decoration: underline;
}

.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-view {
  display: grid;
  gap: 16px;
}

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

.summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.current-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #c9d6ea;
  border-radius: 999px;
  background: #f8fbff;
  color: #183b6b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-modules {
  display: grid;
  gap: 12px;
}

.module-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.module-heading h2,
.module-heading p {
  margin: 0;
}

.module-heading > p {
  max-width: 380px;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

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

.admin-workflow {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f5f9ff);
  box-shadow: var(--shadow);
}

.workflow-copy {
  display: grid;
  align-content: center;
  gap: 6px;
}

.workflow-copy h2,
.workflow-copy p {
  margin: 0;
}

.workflow-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow-steps a {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.workflow-steps a:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.workflow-steps span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.workflow-steps strong {
  font-size: 16px;
}

.workflow-steps small {
  color: var(--muted);
  line-height: 1.5;
}

.payment-panel {
  margin-bottom: 18px;
}

.payment-panel .card-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1fr);
  gap: 16px;
}

.payment-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.payment-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.payment-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.payment-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.payment-amount strong {
  color: var(--blue);
  font-size: 26px;
}

.payment-orders {
  display: grid;
  align-content: start;
  gap: 10px;
}

.payment-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #fff;
}

.payment-order-card div {
  display: grid;
  gap: 4px;
}

.payment-order-card span,
.payment-order-card small {
  color: var(--muted);
}

.payment-order-card b {
  color: var(--blue);
  font-size: 20px;
}

.home-entry-card {
  --module-accent: var(--blue);
  --module-soft: #e8f6ff;
  position: relative;
  min-height: 118px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(201, 230, 255, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--soft-shadow);
}

.home-entry-card::before {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--module-accent);
  content: "";
}

.home-entry-card:hover {
  border-color: color-mix(in srgb, var(--module-accent) 42%, #ffffff);
  transform: translateY(-3px);
}

.home-entry-card[data-tone="project"] {
  --module-accent: #0e7490;
  --module-soft: #dff7fb;
}

.home-entry-card[data-tone="product"] {
  --module-accent: #15803d;
  --module-soft: #e5f7eb;
}

.home-entry-card[data-tone="content"] {
  --module-accent: #7c3aed;
  --module-soft: #f0e9ff;
}

.home-entry-card[data-tone="guide"] {
  --module-accent: #b45309;
  --module-soft: #fff2d7;
}

.home-entry-card[data-tone="faq"] {
  --module-accent: #2563eb;
  --module-soft: #e8f0ff;
}

.home-entry-card[data-tone="admin"] {
  --module-accent: #be123c;
  --module-soft: #fff0f4;
}

.home-entry-card[data-tone="owner"] {
  --module-accent: #334155;
  --module-soft: #eef2f7;
}

.module-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  color: var(--module-accent);
  background: var(--module-soft);
  font-size: 20px;
  font-weight: 900;
}

.module-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.module-kicker {
  color: var(--module-accent);
  font-size: 12px;
  font-weight: 900;
}

.module-content strong {
  font-size: 18px;
  line-height: 1.25;
}

.module-content small {
  color: var(--muted);
  line-height: 1.55;
}

.module-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--module-accent) 26%, #ffffff);
  border-radius: 999px;
  color: var(--module-accent);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 16px;
}

.admin-card {
  min-width: 0;
  padding: 18px;
}

.card-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.project-form {
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 0.55fr 0.6fr 0.7fr 0.9fr auto;
}

.project-list-card .card-heading {
  align-items: center;
}

.project-list-card .card-heading p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.project-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: #f8fbff;
}

.project-search-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.project-search-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.project-result-count {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #dbe6f5;
  border-radius: 999px;
  background: #fff;
  color: #40516a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.project-create-dialog {
  width: min(760px, calc(100% - 28px));
  border-radius: 12px;
}

.project-create-form {
  display: grid;
  gap: 16px;
}

.project-create-form h2,
.project-create-form p {
  margin: 0;
}

.dialog-subtitle {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dialog-safe-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

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

.project-create-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.project-create-grid label.wide,
.project-create-grid .wide {
  grid-column: 1 / -1;
}

.project-create-grid input,
.project-create-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.project-create-grid input:required,
.project-create-grid select:required {
  border-color: #b9c8dd;
}

.community-hint {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.project-address-map-button {
  width: fit-content;
  min-height: 32px;
  margin-top: 6px;
  padding: 0 12px;
}

#projectFormName {
  display: none;
}

.community-suggest {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  max-height: 232px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(11, 40, 72, 0.1);
}

.community-suggest.wide {
  grid-column: 1 / -1;
  margin-top: -6px;
}

.community-option {
  display: grid;
  gap: 3px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  background: #f8fbff;
  color: #183b6b;
  text-align: left;
  cursor: pointer;
}

.community-option:hover {
  border-color: #c9d6ea;
  background: #eef4ff;
}

.community-option strong {
  font-size: 13px;
}

.community-option span,
.community-empty {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.community-empty {
  padding: 8px 10px;
}

.project-map-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  color: #526176;
  background: #f8fbff;
  font-size: 12px;
  line-height: 1.55;
}

.project-coordinate-details {
  grid-column: 1 / -1;
  border: 1px solid #dbe6f5;
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fbff;
}

.project-coordinate-details summary {
  cursor: pointer;
  color: #0f4c81;
  font-size: 13px;
  font-weight: 800;
}

.project-coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.project-coordinate-details p {
  margin: 8px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.admin-form input,
.admin-form select,
.login-card input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.user-create-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.enterprise-invite-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #b8e9ff;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(232, 246, 255, 0.92), rgba(255, 255, 255, 0.9));
}

.enterprise-invite-panel h3,
.enterprise-invite-panel p {
  margin: 0;
}

.enterprise-invite-panel p:not(.eyebrow),
.enterprise-invite-panel small {
  color: var(--muted);
  line-height: 1.55;
}

.enterprise-invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.enterprise-invite-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c9d6ea;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.user-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.user-create-head h3,
.user-create-head p {
  margin: 0;
}

.user-create-head p:not(.eyebrow) {
  color: var(--muted);
}

.user-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.user-create-grid label,
.user-controls label {
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.user-create-grid input,
.user-create-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.project-file-field {
  min-height: 40px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 7px 10px;
  border: 1px dashed #b9c8dd;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.project-file-field input {
  min-height: 0;
  padding: 0;
  border: 0;
  font-size: 12px;
}

.project-file-field.compact {
  min-height: 36px;
}

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

.user-page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.user-page-summary article {
  padding: 14px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #fff;
}

.user-page-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-page-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-size: 26px;
}

.user-group {
  display: grid;
  gap: 10px;
}

.user-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.user-group-header h3,
.user-group-header p {
  margin: 0;
}

.user-group-header p {
  color: var(--muted);
  font-size: 13px;
}

.user-group-header strong {
  min-width: 42px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
}

.user-group-list {
  display: grid;
  gap: 10px;
}

.enterprise-tree-list {
  display: grid;
  gap: 14px;
}

.enterprise-account-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.enterprise-account-heading,
.enterprise-child-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #40516a;
}

.enterprise-account-heading span,
.enterprise-child-header span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
}

.enterprise-account-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.enterprise-account-heading small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.enterprise-child-list {
  display: grid;
  gap: 10px;
  margin-left: 26px;
  padding-left: 18px;
  border-left: 2px solid #dbe6f5;
}

.enterprise-child-header strong {
  min-width: 30px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: #fff;
  font-size: 12px;
}

.enterprise-child-list .managed-user-card {
  border-color: #e2eaf6;
  box-shadow: none;
}

.user-card,
.project-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #fff;
}

.user-card {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.user-card input,
.user-card select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 8px;
}

.user-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}

.user-controls button {
  align-self: end;
  min-height: 36px;
}

.user-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.user-profile-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.user-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.user-title-row strong {
  color: var(--ink);
  font-size: 16px;
}

.user-title-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-badge-row span,
.user-type-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #40516a;
  font-size: 12px;
  font-weight: 800;
}

.user-type-badge.enterprise {
  color: #075985;
  background: #e0f2fe;
}

.user-type-badge.member {
  color: #6d4c00;
  background: #fff5d6;
}

.user-type-badge.personal {
  color: #31503a;
  background: #e9f8ee;
}

.user-edit-panel {
  border-top: 1px solid #e6eef8;
  background: #fbfdff;
}

.user-edit-panel summary {
  cursor: pointer;
  padding: 10px 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.user-edit-panel[open] summary {
  border-bottom: 1px solid #e6eef8;
}

.account-readonly-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  color: #40516a;
  background: #f8fbff;
}

.account-readonly-note strong {
  color: var(--ink);
  font-size: 13px;
}

.account-readonly-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.user-edit-panel .user-controls {
  padding: 14px;
}

.module-permission-panel {
  margin: 0 14px 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.module-permission-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.module-permission-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.module-permission-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.module-permission-head b {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
}

.module-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.module-permission-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e3ebf6;
  border-radius: 8px;
  background: #fff;
}

.module-permission-select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 8px;
  color: #183b6b;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 800;
}

.module-permission-item input[type="checkbox"] {
  width: 16px;
  min-height: auto;
  margin-top: 3px;
  accent-color: var(--blue);
}

.module-permission-item strong {
  display: block;
  color: #183b6b;
  font-size: 13px;
}

.module-permission-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-save-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 14px;
}

.user-name strong,
.project-title strong {
  display: block;
  font-size: 15px;
}

.user-name span,
.user-membership,
.project-title span,
.project-meta {
  color: var(--muted);
  font-size: 12px;
}

.user-membership {
  display: block;
  margin-top: 4px;
  color: #40516a;
  font-weight: 700;
}

.project-card {
  grid-template-columns: 156px minmax(0, 1fr) auto;
  align-items: start;
}

.project-thumb {
  width: 156px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.project-thumb.empty span {
  padding: 0 12px;
  color: #7c8aa0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.project-main-info {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.project-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-detail-chips span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #40516a;
  font-size: 12px;
  font-weight: 700;
}

.project-location-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
}

.project-location-card.compact {
  grid-template-columns: 72px minmax(0, 1fr);
}

.project-location-visual {
  position: relative;
  min-height: 58px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.28) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.24) 1px, transparent 1px),
    linear-gradient(135deg, #eef6ff, #ffffff);
  background-size: 18px 18px, 18px 18px, auto;
}

.project-location-visual::before,
.project-location-visual::after {
  position: absolute;
  content: "";
}

.project-location-visual::before {
  left: 12%;
  right: 8%;
  top: 50%;
  height: 2px;
  transform: rotate(-18deg);
  background: rgba(14, 165, 233, 0.44);
}

.project-location-visual::after {
  left: 18%;
  right: 12%;
  top: 24%;
  height: 2px;
  transform: rotate(24deg);
  background: rgba(37, 99, 235, 0.32);
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -70%) rotate(-45deg);
  background: #ef4444;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
  z-index: 1;
}

.map-pin::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  content: "";
}

.project-location-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.project-location-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-location-copy span {
  color: var(--muted);
  font-size: 12px;
}

.project-location-card.needs-coordinate .project-location-visual {
  filter: saturate(0.82);
}

.project-map-dialog {
  width: min(960px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.project-map-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(3px);
}

.project-map-panel {
  overflow: hidden;
  border: 1px solid #dbe6f5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.project-map-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e6eef8;
}

.project-map-head h3,
.project-map-head p {
  margin: 0;
}

.project-map-head h3 {
  color: var(--ink);
  font-size: 18px;
}

.project-map-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.project-map-frame-wrap {
  height: min(560px, 62vh);
  background: #eef2f7;
}

.project-map-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.project-map-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e6eef8;
  background: #fbfdff;
}

.project-edit-panel {
  margin-top: 2px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.project-edit-panel summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #183b6b;
  font-size: 13px;
  font-weight: 800;
  list-style-position: inside;
}

.project-edit-panel[open] summary {
  border-bottom: 1px solid #dbe6f5;
  background: #eef4ff;
}

.project-edit-readonly {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed #c9d6ea;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.project-edit-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  align-items: stretch;
}

.project-edit-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.project-edit-field.wide {
  grid-column: span 2;
}

.project-edit-field.file-field {
  grid-column: span 2;
}

.project-edit-field span {
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.project-edit-field input,
.project-edit-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #c9d6ea;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}

.project-edit-field input:focus,
.project-edit-field select:focus {
  outline: 2px solid rgba(47, 107, 191, 0.16);
  border-color: var(--blue);
}

.project-edit-field.file-field input {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
}

.project-edit-submit {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-actions .primary-button,
.project-actions .ghost-button {
  min-height: 34px;
  padding: 0 12px;
}

.role-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #183b6b;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.disabled {
  background: #f1f5f9;
  color: #64748b;
}

.empty-line,
.permission-note {
  margin: 0;
  padding: 14px;
  border: 1px dashed #c9d6ea;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbff;
}

.platform-view {
  gap: 18px;
}

.platform-table {
  width: 100%;
  overflow: auto;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #fff;
}

.platform-table table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.platform-table th,
.platform-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6eef8;
  text-align: left;
  vertical-align: top;
}

.platform-table th {
  background: #f8fbff;
  color: #526176;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-table td {
  color: var(--ink);
  font-size: 13px;
}

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

.platform-table strong {
  display: block;
  color: #10243f;
}

.platform-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.platform-user-tree {
  display: grid;
  gap: 14px;
  min-width: 760px;
  padding: 12px;
}

.platform-user-tree-head,
.platform-enterprise-head,
.platform-user-group-head,
.platform-child-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-user-tree-head {
  padding: 4px 2px 2px;
}

.platform-user-tree-head span,
.platform-enterprise-head span,
.platform-child-title span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
}

.platform-user-tree-head strong,
.platform-child-title strong,
.platform-user-group-head > span {
  min-width: 32px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.platform-user-tree-head small,
.platform-enterprise-head small,
.platform-user-group-head small {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.platform-enterprise-group,
.platform-user-flat-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.platform-enterprise-head strong,
.platform-user-group-head strong {
  color: var(--ink);
  font-size: 15px;
}

.platform-enterprise-head small {
  margin-left: auto;
}

.platform-user-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.6fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid #e2eaf6;
  border-radius: 8px;
  background: #fff;
}

.platform-user-card.is-parent {
  border-color: #cfe4ff;
  background: #f8fbff;
}

.platform-user-main strong,
.platform-user-main small {
  display: block;
}

.platform-user-main strong {
  color: var(--ink);
  font-size: 14px;
}

.platform-user-main small {
  color: var(--muted);
}

.platform-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.platform-user-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #40516a;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
}

.platform-child-list,
.platform-user-flat-list {
  display: grid;
  gap: 10px;
}

.platform-child-list {
  margin-left: 26px;
  padding-left: 18px;
  border-left: 2px solid #dbe6f5;
}

.platform-user-group-head {
  justify-content: space-between;
}

.platform-user-group-head strong,
.platform-user-group-head small {
  display: block;
}

@media (max-width: 980px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-summary,
  .admin-home-grid,
  .admin-workflow,
  .workflow-steps,
  .admin-grid,
  .user-create-grid,
  .user-page-summary,
  .payment-layout,
  .register-grid,
  .membership-picker,
  .membership-cards {
    grid-template-columns: 1fr;
  }

  .payment-order-card {
    grid-template-columns: 1fr;
  }

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

  .module-heading > p {
    max-width: none;
    text-align: left;
  }

  .home-entry-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .module-icon {
    width: 44px;
    height: 44px;
  }

  .module-action {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .user-create-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-form,
  .project-form,
  .project-toolbar,
  .project-create-grid,
  .enterprise-invite-row,
  .user-card,
  .project-card,
  .project-edit-grid {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    width: 100%;
    max-height: 220px;
  }

  .project-location-card {
    grid-template-columns: 1fr;
  }

  .project-map-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .enterprise-account-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .enterprise-account-heading small {
    margin-left: 0;
  }

  .enterprise-child-list {
    margin-left: 0;
    padding-left: 12px;
  }

  .platform-user-tree {
    min-width: 0;
  }

  .platform-user-card {
    grid-template-columns: 1fr;
  }

  .platform-user-meta {
    justify-content: flex-start;
  }

  .platform-enterprise-head,
  .platform-user-tree-head,
  .platform-user-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-enterprise-head small,
  .platform-child-list {
    margin-left: 0;
  }

  .platform-child-list {
    padding-left: 12px;
  }
}
