:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: #cbd5f5;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --shadow-soft: 0 12px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

label {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.brand-layout {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
  background: var(--surface-muted);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  padding: 4px;
  object-fit: contain;
  background: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.brand-subtitle {
  margin-top: 0.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.button-name-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button-name-link:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--accent);
  color: var(--text-primary);
}

.brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-header-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.brand-select {
  appearance: none;
  border: 1px solid #d1d5db;
  background-color: #fff;
  border-radius: .6rem;
  padding: .35rem .9rem;
  font-size: .85rem;
  color: #374151;
  cursor: pointer;
}

.brand-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.locale-switcher {
  position: relative;
}

.locale-dropdown {
  position: relative;
  display: inline-block;
}

.locale-dropdown summary {
  list-style: none;
}

.locale-dropdown summary::-webkit-details-marker {
  display: none;
}

.locale-summary {
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.locale-dropdown[open] .locale-summary {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.locale-dropdown-menu {
  position: absolute;
  right: 0;
  margin-top: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  min-width: 170px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.locale-dropdown-button {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.locale-dropdown-button + .locale-dropdown-button {
  margin-top: 0.15rem;
}

.locale-dropdown-button:hover:not(:disabled) {
  background: var(--surface-muted);
}

.locale-dropdown-button.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
}

.locale-dropdown-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.locale-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.brand-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: .5rem 1rem;
}

.brand-stack > * + * {
  margin-top: 1.25rem;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.brand-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.brand-card.budget-execution-card {
  margin-top: 0 !important;
}

.brand-auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.brand-auth-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.brand-auth-form input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
}

.brand-auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.brand-auth-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.brand-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.brand-link:hover {
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.brand-card + .brand-card {
  margin-top: 1.25rem;
}

.brand-subtext {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card + .card {
  margin-top: 1.25rem;
}

.brand-title {
  margin: 0 0 0.85rem;
  line-height: 1.3;
  font-size: 1.85rem;
  font-weight: 700;
}

.brand-heading {
  margin: 0 0 0.85rem;
  line-height: 1.3;
  font-size: 1.5rem;
  font-weight: 600;
}

.brand-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-muted {
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.brand-info {
  background: rgba(37, 99, 235, 0.04);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.brand-info-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.brand-info-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.brand-table th,
.brand-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  text-align: initial;
  vertical-align: top;
}

.brand-table td.text-right {
  text-align: end;
}

.brand-table th {
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #475569;
  letter-spacing: 0.04em;
  align-content: center;
}

.brand-table tbody tr:last-child td {
  border-bottom: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.brand-table td.budget-cell {
  padding: 0.3rem 0.5rem !important;
}

.brand-table td.budget-cell.cell-order {
  width: 50px;
  display: flex;
}

.plan-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.plan-container_OUT {
  padding: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.02);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.plan-item input[type="checkbox"] {
  margin-top: 0.15rem;
}

.plan-item-label {
  flex: 1;
  line-height: 1.4;
  color: var(--text-primary);
}

.plan-item-applied {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.plan-footer {
  display: flex;
  flex-direction: column;
}

th,
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  text-align: left;
  vertical-align: top;
}

th {
  text-transform: uppercase;
  font-size: 0.76rem;
  color: #475569;
  letter-spacing: 0.04em;
}

tbody tr:last-child td {
  border-bottom: none;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  min-height: 24px;
  min-width: 24px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.brand-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.brand-button:disabled,
.brand-button[disabled],
.brand-button.disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.brand-button-ghost:disabled,
.brand-button-ghost[disabled],
.brand-button-ghost.disabled {
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.35);
}

.brand-button.danger:disabled,
.brand-button.danger[disabled],
.brand-button-ghost.danger:disabled,
.brand-button-ghost.danger[disabled],
.danger.disabled {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.24);
  color: #b91c1c;
}

.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.brand-button-secondary {
  border-color: #475569;
  background: #475569;
}

.btn-secondary,
button.btn.btn-secondary,
a.btn.btn-secondary {
  border-color: #475569;
  background: #475569;
}

.brand-button-ghost {
  border-color: transparent;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
}

.brand-button-ghost:hover {
  background: rgba(15, 23, 42, 0.1);
  box-shadow: none;
}

.brand-button.icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
}

.brand-button.icon-button svg {
  width: 24px;
  height: 24px;
}

.brand-insert-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.brand-insert-button:hover,
.brand-insert-button:focus-visible {
  color: #1d4ed8;
}

.brand-insert-button svg {
  width: 24px;
  height: 24px;
}

.brand-toggle-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.brand-toggle-button:hover,
.brand-toggle-button:focus-visible {
  color: var(--accent);
}

.brand-toggle-button svg {
  width: 24px;
  height: 24px;
}

.brand-toggle-button .is-hidden {
  display: none;
}

.btn-ghost,
button.btn.btn-ghost,
a.btn.btn-ghost {
  border-color: transparent;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
}

.btn-ghost:hover,
button.btn.btn-ghost:hover,
a.btn.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.1);
  box-shadow: none;
}

/* Utility: consistent icon-only button sizing & centering */
.icon-button-24 {
  width: 40px;
  height: 34px;
  padding: 0;
}

.icon-button-24 svg {
  width: 20px;
  height: 20px;
  display: block;
}

a svg {
  width: 20px
}

.brand-alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fef9c3;
  border: 1px solid #facc15;
  color: #854d0e;
  font-size: 0.95rem;
}

.brand-flash-success {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.95rem;
}

.brand-flash-error {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.95rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-badge-role-admin {
  background: #eef6ff;
  border-color: #cde7ff;
  color: #1e40af;
}

.brand-badge-status-pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  font-size: 0.6rem;
  padding: 0.2rem 0.45rem;
}

.brand-badge-status-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.brand-badge-status-rejected {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.brand-empty {
  padding: 0.3rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.brand-pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.brand-pagination nav {
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  padding: 0.2rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.brand-pagination nav ul {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0 0.35rem;
}

.brand-pagination nav li {
  display: flex;
}

.brand-pagination nav span,
.brand-pagination nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.brand-pagination nav a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.brand-pagination nav span[aria-current="page"],
.brand-pagination nav a[aria-current] {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  cursor: default;
}

.brand-pagination nav span.disabled,
.brand-pagination nav span.ellipsis {
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}

.brand-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.15rem;
}

.form-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-column-gap: 20px;
  grid-row-gap: 10px;
  padding-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.15rem;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-grid label,
.row label,
.row-3 label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
  margin-top: 0.75rem;
  font-size: 0.93rem;
  color: var(--text-primary);
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.row input,
.row select,
.row textarea,
.row-3 input,
.row-3 select,
.row-3 textarea {
  width: calc(100% - 1rem);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-size: 0.95rem;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.row input:focus,
.row select:focus,
.row textarea:focus,
.row-3 input:focus,
.row-3 select:focus,
.row-3 textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.brand-checkbox-label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
}

.field-with-toggle .field-with-toggle__control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-with-toggle .field-with-toggle__control input,
.field-with-toggle .field-with-toggle__control select,
.field-with-toggle .field-with-toggle__control textarea {
  flex: 1;
  width: 100%;
  margin: 0;
}

.row-two-cols {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.entities-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.entities-form .brand-card {
  margin: 0;
}

.entities-form .brand-section-heading {
  align-items: center;
  gap: 0.75rem;
}

.entities-form .brand-heading {
  margin-bottom: 0.4rem;
}

.entities-form .brand-subtext {
  margin: 0;
}

.entities-id-badge {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 600;
}

.field-sm {
  max-width: 18rem;
}

.field-md {
  max-width: 24rem;
}

.inline-checkbox-stack {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inline-checkbox-stack label {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
  margin: 0;
}

.inline-checkbox-stack .brand-error {
  margin-top: 0.35rem;
}

.entities-contact-verification {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entities-contact-note {
  margin-top: 0.15rem;
}

.entities-form-actions {
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.entities-form-error-list {
  margin: 0.5rem 0 0 1rem;
}

.entities-relationships-card {
  margin-bottom: 1.5rem;
}

.entities-relationships-card .table-responsive {
  margin-bottom: 1rem;
}

.relationships-table-actions {
  width: 140px;
  text-align: right;
}

.relationships-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.relationships-fraction-meta {
  margin-top: 0.15rem;
}

.relationships-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
}

.relationships-add-form .relationships_new {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.relationships-add-form .field-sm {
  min-width: 220px;
}

.relationships-add-form .field-md {
  min-width: 240px;
}

.entities-page-header {
  margin-bottom: 1.5rem;
}

.entities-page-header .brand-heading {
  margin-bottom: 0.5rem;
}

.entities-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.entities-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.entities-note-bottom {
  margin-bottom: 1.35rem;
}

.entities-note-lg {
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.entities-summary {
  margin-bottom: 1.2rem;
}

.field-wide {
  max-width: 420px;
}

.entities-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.entities-column-mapping {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.entities-select-sm {
  min-width: 220px;
}

.entities-select-md {
  min-width: 200px;
}

.entities-text-error {
  margin-top: 0.5rem;
}

.entities-section-spaced {
  margin-top: 2rem;
}

.entities-grid-spaced {
  margin-top: 1rem;
}

.entities-actions {
  margin-top: 1.5rem;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.share-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 0.65rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  padding: 0;
}

.share-toggle-button.is-active {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
}

.share-toggle-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.share-toggle-icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.share-toggle-button .share-toggle-icon.is-hidden {
  display: none;
}

.share-toggle-button .share-toggle-icon svg {
  fill: currentColor;
}

.is-hidden {
  display: none !important;
}

.brand-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.brand-field input,
.brand-field select,
.brand-field textarea {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  width: 100%;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface);
}

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

.brand-field input:focus,
.brand-field select:focus,
.brand-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

body input[type="checkbox"],
body input[type="radio"] {
  width: unset !important;
}

.brand-toolbar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.brand-toolbar-compact {
  gap: 0.35rem;
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.brand-inline-form {
  display: inline;
  margin: 0;
}

.brand-divider {
  height: 20px;
}

.owners {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--surface);
}

.owner-card {
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
  background: rgba(37, 99, 235, 0.05);
}

.owner-card:last-child {
  margin-bottom: 0;
}

.owner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.owner-search-input {
  width: 100%;
}

.brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}

.brand-summary {
  margin-top: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(37, 99, 235, 0.05);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.brand-summary-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.brand-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-currency {
  text-align: end !important;
  white-space: nowrap;
}

.movement-clickable {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.4rem;
  border-radius: 10px;
  transition: background-color 0.2s ease;
  color: inherit;
  text-decoration: none;
}

.movement-clickable:hover {
  background: rgba(59, 130, 246, 0.08);
  text-decoration: none;
}

.movement-clickable:active {
  background: rgba(59, 130, 246, 0.14);
  text-decoration: none;
}

.text-in {
  color: #15803d;
}

.text-out {
  color: #dc2626;
}

.import-disabled-column {
  background: rgba(148, 163, 184, 0.3);
}

.alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fef9c3;
  border: 1px solid #facc15;
  color: #854d0e;
  font-size: 0.95rem;
}

.table-responsive {
  overflow-x: auto;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.pagination nav {
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  padding: 0.2rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.pagination nav ul {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0 0.35rem;
}

.pagination nav li {
  display: flex;
}

.pagination nav span,
.pagination nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.pagination nav a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.pagination nav span[aria-current="page"],
.pagination nav a[aria-current] {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  cursor: default;
}

.pagination nav span.disabled,
.pagination nav span.ellipsis {
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}

.brand-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.danger {
  border-color: #ef4444;
  background: #ef4444;
  color: var(--accent-contrast);
}

.fractions-heading-title {
  display: flex;
  gap: .5rem;
}

@media (max-width: 780px) {
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .brand-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-title {
    font-size: 1.6rem;
  }

  .brand-heading {
    font-size: 1.2rem;
  }

  .brand-wrap {
    padding: 1.25rem;
  }

  .brand-pagination {
    justify-content: center;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #18181b;
    --surface-muted: #111827;
    --border-subtle: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(148, 163, 184, 0.28);
    --text-primary: #EDEDEC;
    --text-muted: #A1A09A;
    --accent: #3b82f6;
    --accent-contrast: #0b1120;
    --shadow-soft: 0 16px 28px rgba(15, 23, 42, 0.45);
  }

  .brand-logo {
    background: #0b1120;
    border-color: rgba(148, 163, 184, 0.35);
  }
}
