* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #f5f5f7;
  color: #1c1c1e;
  margin: 0;
  padding: 24px;
}

.page {
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 767.98px) {
  body {
    padding: 16px;
  }
}

/* Application header (spec/adaptive-ui.md §3) */

.app-header {
  margin-bottom: 24px;
}

.app-header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.app-logo {
  font-weight: 700;
  font-size: 18px;
  color: #1c1c1e;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #d0d0d5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 0;
}

.nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: #1c1c1e;
  border-radius: 1px;
}

.user-avatar-button {
  display: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: auto;
  border: none;
  border-radius: 999px;
  background: #0a66c2;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.user-avatar-button[hidden] {
  display: none !important;
}

.app-nav-backdrop {
  display: none;
}

.app-nav-header,
.nav-close {
  display: none;
}

nav.app-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

nav.app-nav a {
  color: #0a66c2;
  text-decoration: none;
  font-weight: 600;
}

nav.app-nav a:hover {
  text-decoration: underline;
}

/* Mobile: collapse nav into an off-canvas drawer, keep only the essentials
   (menu trigger, compact logo, user control) visible in the bar itself. */
@media (max-width: 767.98px) {
  .nav-toggle {
    display: flex;
  }

  .user-avatar-button {
    display: flex;
  }

  .app-logo {
    flex: 1;
  }

  .app-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1150;
  }

  .app-nav-backdrop[hidden] {
    display: none;
  }

  nav.app-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
    overflow-y: auto;
    max-height: 100dvh;
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1200;
  }

  nav.app-nav.open {
    transform: translateX(0);
  }

  .app-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .app-nav-title {
    font-weight: 700;
    font-size: 15px;
  }

  .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
  }

  .nav-close:hover {
    background: #f0f0f2;
  }

  nav.app-nav a {
    padding: 12px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f2f2f4;
  }

  nav.app-nav .user-menu {
    margin-left: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  nav.app-nav .user-menu-logout {
    width: 100%;
    min-height: 44px;
  }
}

body.nav-open-lock {
  overflow: hidden;
}

h1 {
  font-size: 22px;
  margin-bottom: 24px;
}

section.form-section {
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

section.form-section h2 {
  font-size: 16px;
  margin: 0 0 16px;
}

section.form-section h3.subgroup {
  font-size: 14px;
  color: #555;
  margin: 20px 0 12px;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  flex: 1 1 220px;
}

.field label {
  font-size: 13px;
  color: #444;
  margin-bottom: 4px;
}

.field input[type='text'],
.field input[type='tel'],
.field input[type='number'],
.field input[type='date'],
.field input[type='email'],
.field input[type='password'],
.field select,
.field textarea {
  /* Form controls have an intrinsic min-content size that flexbox honors by default even
     under stretch alignment (min-width:auto) — without this, an input can refuse to
     shrink below ~170px and blow out a narrower flex parent (e.g. the mobile search bar
     next to the filters toggle). */
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

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

.field input:disabled,
.field input[readonly],
.field select:disabled {
  background: #f0f0f2;
  color: #666;
}

.field input.invalid,
.field select.invalid {
  border-color: #d92d20;
  background: #fff5f5;
}

.field-error {
  color: #d92d20;
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
  display: block;
}

.service-block {
  border: 1px solid #e5e5e7;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.service-block .service-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
  min-height: 44px;
}

/* Mobile: one column for every field group (spec/adaptive-ui.md §7.1), larger touch
   targets, and >=16px inputs so iOS doesn't auto-zoom on focus (§7.2). */
@media (max-width: 767.98px) {
  section.form-section {
    padding: 16px;
  }

  .field-row {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
  }

  .field {
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }

  .field input[type='text'],
  .field input[type='tel'],
  .field input[type='number'],
  .field input[type='date'],
  .field select,
  .field textarea {
    font-size: 16px;
    min-height: 44px;
  }
}

.computed-total {
  font-weight: 600;
  margin-top: 12px;
}

.warning-banner {
  background: #fff4e5;
  border: 1px solid #f5a623;
  color: #8a5300;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
}

button.primary {
  background: #0a66c2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover {
  background: #084e96;
}

.button-link {
  display: inline-block;
  background: #0a66c2;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.button-link:hover {
  background: #084e96;
}

.button-link.small {
  padding: 4px 10px;
  font-size: 12px;
  margin-bottom: 0;
}

#confirmation-panel {
  background: #fff;
  border: 1px solid #b6e3c6;
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 20px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.summary-list li {
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
}

.summary-customer {
  color: #555;
  margin-top: -8px;
}

/* Order cards — used at every breakpoint. A dense multi-column table read as clutter even
   on desktop, so the list uses the same compact card everywhere and just lets a responsive
   grid put more of them per row as width allows. */

.order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: start;
}

.order-card {
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
  cursor: pointer;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.order-card-title {
  font-size: 15px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-card-customer {
  margin: 4px 0 10px;
  font-size: 13px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-financials {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.order-card-figure {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.order-card-figure .figure-label {
  font-size: 13px;
  color: #555;
}

.order-card-figure .figure-value {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}

.order-card-figure-remaining .figure-value {
  font-size: 19px;
  font-weight: 700;
  color: #0a66c2;
}

.order-card-updated {
  margin: 10px 0 0;
  font-size: 12px;
  color: #777;
}

.order-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f2;
}

.order-card-view {
  margin-bottom: 0;
}

.card-menu {
  position: relative;
}

.card-menu-trigger {
  width: 44px;
  height: 44px;
  border: 1px solid #d0d0d5;
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.card-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 200px;
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.card-menu-list[hidden] {
  display: none;
}

.card-menu-list a,
.card-menu-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  color: #1c1c1e;
  cursor: pointer;
}

.card-menu-list a:hover,
.card-menu-list button:hover {
  background: #f5f5f7;
}

.card-menu-list button.destructive {
  color: #d92d20;
}

.empty-state {
  color: #777;
  padding: 16px 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Sticky bottom action bar on the order form only, so Save stays reachable on a long
   scroll without covering inputs or validation messages (spec/adaptive-ui.md §7.4). */
@media (max-width: 767.98px) {
  #order-form .form-actions {
    position: sticky;
    bottom: 0;
    margin: 20px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #f5f5f7;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 50;
  }

  #order-form .form-actions button {
    flex: 1;
    min-height: 44px;
  }
}

button.secondary {
  background: #fff;
  color: #1c1c1e;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary:hover {
  background: #f0f0f2;
}

button.secondary:disabled,
button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-link.destructive,
button.button-link.destructive {
  background: #d92d20;
  border: none;
  cursor: pointer;
  font: inherit;
}

.button-link.destructive:hover,
button.button-link.destructive:hover {
  background: #a91b0f;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filter-bar .field {
  min-width: 160px;
}

.filter-actions {
  min-width: unset;
}

.orders-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.orders-page-heading h1 {
  margin-bottom: 0;
}

.create-order-button {
  margin-bottom: 0;
  flex-shrink: 0;
}

.filters-toggle {
  display: none;
}

.filters-count {
  font-weight: 700;
}

/* Mobile: search stays full-width, the rest of the filters collapse behind a toggle
   with an active-filter count (spec/adaptive-ui.md §5). */
@media (max-width: 767.98px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .filter-search-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
  }

  .filter-search-field {
    flex: 1;
    min-width: 0;
  }

  .filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .filters-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
  }

  .filters-panel.open {
    display: flex;
  }

  .filter-bar .field {
    min-width: 0;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .filter-search-row,
  .filters-panel {
    display: contents;
  }
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e5e5e7;
  color: #444;
}

.status-badge.status-draft {
  background: #eee;
  color: #555;
}

.status-badge.status-active {
  background: #e6f0fb;
  color: #0a66c2;
}

.status-badge.status-completed {
  background: #e6f7ec;
  color: #157347;
}

.status-badge.status-cancelled {
  background: #fbe7e6;
  color: #a91b0f;
}

.payment-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e5e5e7;
  color: #444;
}

.payment-status-badge.payment-status-unpaid {
  background: #fbe7e6;
  color: #a91b0f;
}

.payment-status-badge.payment-status-partial {
  background: #fff4e5;
  color: #8a5300;
}

.payment-status-badge.payment-status-paid {
  background: #e6f7ec;
  color: #157347;
}

.payment-status-badge.payment-status-overpaid {
  background: #fff4e5;
  color: #8a5300;
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.order-header-main h1 {
  font-size: 20px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-header-meta {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  color: #555;
  font-size: 14px;
}

.order-header-meta a {
  color: #0a66c2;
}

.order-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.primary-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-more-menu .card-menu-list {
  top: calc(100% + 6px);
  bottom: auto;
}

button.button-link {
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Mobile: stack the header vertically instead of the wide side-by-side layout
   (spec/adaptive-ui.md §6.1) — actions stay a single compact row underneath. */
@media (max-width: 767.98px) {
  .order-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .order-header-actions {
    align-items: stretch;
  }

  .primary-actions {
    width: 100%;
  }

  .primary-actions .button-link {
    flex: 1;
    text-align: center;
  }

  .card-menu.detail-more-menu {
    flex-shrink: 0;
  }
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .order-detail-grid {
    grid-template-columns: 2fr 1fr;
  }

  .financial-summary-card {
    grid-column: 2;
    grid-row: 1 / span 6;
    position: sticky;
    top: 20px;
  }
}

.card {
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 20px 24px;
}

.card h2 {
  font-size: 16px;
  margin: 0 0 14px;
}

.financial-summary-card {
  background: #f7faff;
  border-color: #d3e4f7;
}

.financial-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

/* One column on mobile so large amounts never get cramped (spec/adaptive-ui.md §6.2). */
@media (max-width: 479.98px) {
  .financial-summary-grid {
    grid-template-columns: 1fr;
  }
}

.financial-figure {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.figure-label {
  font-size: 12px;
  color: #555;
}

.figure-value {
  font-size: 18px;
  font-weight: 700;
}

.figure-remaining .figure-value {
  font-size: 22px;
  color: #0a66c2;
}

.payment-status-row {
  margin-bottom: 8px;
}

.summary-method-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  border-top: 1px dashed #d3e4f7;
}

.detail-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  border-bottom: 1px dashed #eee;
  padding-bottom: 8px;
  min-width: 0;
}

.detail-list dt {
  color: #555;
}

.detail-list dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.badge-internal {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #8a5300;
  background: #fff4e5;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.muted {
  color: #999;
  font-weight: 400;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.detail-table td,
.detail-table th {
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
  text-align: left;
  overflow-wrap: anywhere;
}

@media (max-width: 374.98px) {
  .detail-table {
    font-size: 12px;
  }
}

.detail-table td.amount,
.detail-table th.amount {
  text-align: right;
}

.detail-table .total-row td {
  font-weight: 700;
  border-top: 1px solid #ccc;
  border-bottom: none;
}

.dimension-illustration {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed #eee;
  font-size: 14px;
  color: #444;
}

.calc-details {
  margin-top: 14px;
}

.calc-details summary {
  cursor: pointer;
  font-size: 13px;
  color: #0a66c2;
}

.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}

.skeleton-header {
  height: 96px;
  margin-bottom: 20px;
}

.skeleton-card {
  height: 220px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-dialog {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-dialog h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.modal-body p {
  margin: 4px 0;
  font-size: 14px;
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .modal-cancel {
  background: #fff;
  color: #1c1c1e;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions .modal-confirm {
  background: #0a66c2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions .modal-confirm.destructive {
  background: #d92d20;
}

.modal-actions .modal-confirm.destructive:hover {
  background: #a91b0f;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: calc(100vw - 32px);
  background: #1c1c1e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1100;
  overflow-wrap: anywhere;
}

@media (max-width: 479.98px) {
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #157347;
}

.toast-error {
  background: #d92d20;
}

/* Authentication & access control */

.auth-banner {
  margin-bottom: 20px;
}

.mode-badge {
  display: inline-block;
  background: #eef2ff;
  border: 1px solid #6366f1;
  color: #3730a3;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 13px;
}

.user-menu-name {
  font-weight: 600;
}

.user-menu-role {
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 10px;
}

.user-menu-logout {
  background: none;
  border: 1px solid #d0d0d5;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #1c1c1e;
}

.user-menu-logout:hover {
  background: #f5f5f7;
}

.auth-page {
  max-width: 400px;
  margin: 60px auto;
}

.auth-page h1 {
  text-align: center;
}

.auth-page .form-section {
  background: #fff;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  padding: 24px;
}

.auth-page .form-actions {
  flex-direction: column;
}

.auth-page .form-actions button.primary {
  width: 100%;
}

.auth-error {
  background: #fdecea;
  border: 1px solid #d92d20;
  color: #8a1f14;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.role-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.role-badge.role-admin {
  background: #fde7e7;
  color: #b42318;
}

.role-badge.role-manager {
  background: #eef2ff;
  color: #3730a3;
}

.role-badge.role-viewer {
  background: #f3f4f6;
  color: #374151;
}

.invitation-status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.invitation-status-badge.invitation-status-active {
  background: #e6f4ea;
  color: #157347;
}

.invitation-status-badge.invitation-status-used {
  background: #f3f4f6;
  color: #374151;
}

.invitation-status-badge.invitation-status-expired,
.invitation-status-badge.invitation-status-revoked {
  background: #fdecea;
  color: #8a1f14;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.inline-form .field {
  min-width: 180px;
}

.copy-link-button {
  background: none;
  border: 1px solid #d0d0d5;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.copy-link-button:hover {
  background: #f5f5f7;
}
