.app-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.12);
  overflow: visible;
}

.app-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6);
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-card__body {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.modal:not(.datepicker-modal):not(.timepicker-modal) {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  overflow: auto;
}

.modal:not(.datepicker-modal):not(.timepicker-modal) .modal-content {
  border-radius: inherit;
}

.dropdown-content {
  z-index: 9999;
}

:root {
  --app-select-bg: rgba(255, 255, 255, 0.98);
  --app-select-bg-muted: #f8fafc;
  --app-select-panel-bg: rgba(255, 255, 255, 0.98);
  --app-select-panel-border: rgba(15, 23, 42, 0.1);
  --app-select-border: rgba(15, 23, 42, 0.14);
  --app-select-text: #111827;
  --app-select-muted: #64748b;
  --app-select-hover: rgba(30, 58, 138, 0.07);
  --app-select-active: rgba(30, 58, 138, 0.12);
  --app-select-focus: #2563eb;
  --app-select-focus-ring: rgba(37, 99, 235, 0.16);
  --app-select-radius: 12px;
  --app-select-logo-size: 18px;
  --app-field-bg: rgba(255, 255, 255, 0.98);
  --app-field-bg-muted: #f8fafc;
  --app-field-border: rgba(15, 23, 42, 0.14);
  --app-field-border-strong: rgba(15, 23, 42, 0.2);
  --app-field-text: #111827;
  --app-field-placeholder: #94a3b8;
  --app-field-label: #64748b;
  --app-field-focus: #2563eb;
  --app-field-focus-ring: rgba(37, 99, 235, 0.16);
  --app-field-invalid: #dc2626;
  --app-field-valid: #059669;
  --app-field-radius: 12px;
  --app-field-height: 38px;
  --app-field-padding-x: 12px;
  --app-field-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.input-field {
  margin-top: 0.6rem;
  margin-bottom: 0.6rem;
}

.input-field > label {
  color: var(--app-field-label);
  font-size: 11px;
  line-height: 1.1;
  left: 12px;
  max-width: calc(100% - 24px);
  transform: translateY(10px);
  transform-origin: 0 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.input-field > label.active {
  color: var(--app-field-label);
  transform: translateY(-8px) scale(0.85);
  background: var(--app-field-bg);
  border-radius: 999px;
  padding: 0 4px;
}

.input-field .prefix {
  width: 2.2rem;
  color: var(--app-field-label);
  font-size: 18px;
  line-height: var(--app-field-height);
}

.input-field .prefix.active {
  color: var(--app-field-focus);
}

.input-field .prefix ~ input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.input-field .prefix ~ textarea.materialize-textarea,
.input-field .prefix ~ .select-wrapper,
.input-field .prefix ~ .autocomplete-content {
  width: calc(100% - 2.4rem);
  margin-left: 2.4rem;
}

.input-field .prefix ~ label,
.input-field .prefix ~ .helper-text {
  margin-left: 0;
  left: 2.4rem;
  width: calc(100% - 2.4rem);
  max-width: calc(100% - 2.4rem);
}

.input-field .prefix ~ label.active {
  left: calc(2.4rem - 4px);
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.input-field textarea.materialize-textarea,
input:not([type]):not(.select-dropdown),
input[type='text']:not(.select-dropdown),
input[type='search']:not(.select-dropdown),
input[type='number'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='date'],
input[type='datetime-local'],
textarea {
  box-sizing: border-box;
  border: 1px solid var(--app-field-border);
  border-bottom: 1px solid var(--app-field-border);
  border-radius: var(--app-field-radius);
  background: var(--app-field-bg);
  color: var(--app-field-text);
  box-shadow: var(--app-field-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
input:not([type]):not(.select-dropdown),
input[type='text']:not(.select-dropdown),
input[type='search']:not(.select-dropdown),
input[type='number'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='date'],
input[type='datetime-local'] {
  height: var(--app-field-height);
  line-height: calc(var(--app-field-height) - 2px);
  padding: 0 var(--app-field-padding-x);
  margin-bottom: 0;
}

.input-field textarea.materialize-textarea,
textarea {
  width: 100%;
  max-width: 100%;
  display: block;
  font: inherit;
  min-height: 88px;
  padding: 10px 12px;
  margin-bottom: 0;
  line-height: 1.35;
  resize: vertical;
}

.input-field textarea.materialize-textarea {
  padding-top: 10px;
  padding-bottom: 10px;
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown):focus:not([readonly]),
.input-field textarea.materialize-textarea:focus:not([readonly]),
input:not([type]):not(.select-dropdown):focus:not([readonly]),
input[type='text']:not(.select-dropdown):focus:not([readonly]),
input[type='search']:not(.select-dropdown):focus:not([readonly]),
input[type='number']:focus:not([readonly]),
input[type='email']:focus:not([readonly]),
input[type='password']:focus:not([readonly]),
input[type='url']:focus:not([readonly]),
input[type='date']:focus:not([readonly]),
input[type='datetime-local']:focus:not([readonly]),
textarea:focus:not([readonly]) {
  border-color: var(--app-field-focus);
  border-bottom-color: var(--app-field-focus);
  box-shadow: 0 0 0 3px var(--app-field-focus-ring);
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown):focus:not([readonly]) + label,
.input-field textarea.materialize-textarea:focus:not([readonly]) + label {
  color: var(--app-field-focus);
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown)::placeholder,
.input-field textarea.materialize-textarea::placeholder,
input:not([type]):not(.select-dropdown)::placeholder,
input[type='text']:not(.select-dropdown)::placeholder,
input[type='search']:not(.select-dropdown)::placeholder,
input[type='number']::placeholder,
input[type='email']::placeholder,
input[type='password']::placeholder,
input[type='url']::placeholder,
input[type='date']::placeholder,
input[type='datetime-local']::placeholder,
textarea::placeholder {
  color: var(--app-field-placeholder);
  opacity: 1;
}

.input-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown):disabled,
.input-field textarea.materialize-textarea:disabled,
input:not([type]):not(.select-dropdown):disabled,
input[type='text']:not(.select-dropdown):disabled,
input[type='search']:not(.select-dropdown):disabled,
input[type='number']:disabled,
input[type='email']:disabled,
input[type='password']:disabled,
input[type='url']:disabled,
input[type='date']:disabled,
input[type='datetime-local']:disabled,
textarea:disabled {
  border-color: rgba(15, 23, 42, 0.1);
  border-bottom-color: rgba(15, 23, 42, 0.1);
  background: var(--app-field-bg-muted);
  color: var(--app-field-label);
  box-shadow: none;
  cursor: not-allowed;
}

.input-field input[readonly]:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.input-field textarea.materialize-textarea[readonly],
input[readonly]:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
textarea[readonly] {
  background: var(--app-field-bg-muted);
  border-color: rgba(15, 23, 42, 0.12);
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

.input-field input.valid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.input-field textarea.materialize-textarea.valid {
  border-color: rgba(5, 150, 105, 0.45);
  border-bottom-color: rgba(5, 150, 105, 0.45);
}

.input-field input.invalid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.input-field textarea.materialize-textarea.invalid {
  border-color: rgba(220, 38, 38, 0.45);
  border-bottom-color: rgba(220, 38, 38, 0.45);
}

.input-field input.valid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown):focus,
.input-field textarea.materialize-textarea.valid:focus {
  border-color: var(--app-field-valid);
  border-bottom-color: var(--app-field-valid);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.input-field input.invalid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown):focus,
.input-field textarea.materialize-textarea.invalid:focus {
  border-color: var(--app-field-invalid);
  border-bottom-color: var(--app-field-invalid);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.u-ellipsis,
[data-auto-ellipsis],
.media-inline-preview__name,
.media-inline-preview__type,
.file-name {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.u-ellipsis-inline {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.media-inline-preview__meta {
  min-width: 0;
  flex: 1 1 auto;
}

.input-field input.valid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown) + label,
.input-field textarea.materialize-textarea.valid + label {
  color: var(--app-field-valid);
}

.input-field input.invalid:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown) + label,
.input-field textarea.materialize-textarea.invalid + label {
  color: var(--app-field-invalid);
}

.helper-text {
  color: var(--app-field-label);
  min-height: 12px;
  line-height: 1.2;
  margin-top: 4px;
}

.helper-text::after {
  font-size: 10px;
  line-height: 1.2;
}

.input-field input.invalid ~ .helper-text,
.input-field input.invalid ~ .helper-text::after,
.input-field textarea.invalid ~ .helper-text,
.input-field textarea.invalid ~ .helper-text::after {
  color: var(--app-field-invalid);
}

.input-field input.valid ~ .helper-text,
.input-field input.valid ~ .helper-text::after,
.input-field textarea.valid ~ .helper-text,
.input-field textarea.valid ~ .helper-text::after {
  color: var(--app-field-valid);
}

input[type='color'] {
  height: var(--app-field-height);
  min-height: var(--app-field-height);
  padding: 4px 6px;
  border: 1px solid var(--app-field-border);
  border-radius: var(--app-field-radius);
  background: var(--app-field-bg);
  box-shadow: var(--app-field-shadow);
  cursor: pointer;
}

input[type='color']:focus {
  outline: none;
  border-color: var(--app-field-focus);
  box-shadow: 0 0 0 3px var(--app-field-focus-ring);
}

input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type='color']::-webkit-color-swatch {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
}

input[type='color']::-moz-color-swatch {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
}

input[type='checkbox'] + span:not(.lever),
input[type='radio'] + span {
  color: var(--app-field-text);
  font-size: 12px;
  line-height: 20px;
  min-height: 20px;
  padding-left: 28px;
}

input[type='checkbox'] + span:not(.lever)::before,
input[type='checkbox'] + span:not(.lever)::after {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 4px;
}

input[type='checkbox']:not(.filled-in) + span:not(.lever)::before {
  border: 2px solid rgba(15, 23, 42, 0.35);
}

input[type='checkbox']:checked + span:not(.lever)::before {
  border-right: 2px solid var(--app-field-focus);
  border-bottom: 2px solid var(--app-field-focus);
}

input[type='checkbox'].filled-in + span:not(.lever)::before {
  border-radius: 4px;
}

input[type='checkbox'].filled-in + span:not(.lever)::after {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-top: 2px;
  border: 2px solid rgba(15, 23, 42, 0.3);
}

input[type='checkbox'].filled-in:checked + span:not(.lever)::after {
  border-color: var(--app-field-focus);
  background-color: var(--app-field-focus);
}

input[type='radio'] + span::before,
input[type='radio'] + span::after {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

input[type='radio'] + span::before {
  border: 2px solid rgba(15, 23, 42, 0.35);
}

input[type='radio']:checked + span::after,
input[type='radio'].with-gap:checked + span::after {
  background-color: var(--app-field-focus);
}

input[type='radio']:checked + span::before,
input[type='radio'].with-gap:checked + span::before,
input[type='radio'].with-gap:checked + span::after {
  border-color: var(--app-field-focus);
}

input[type='checkbox']:focus + span:not(.lever)::before,
input[type='radio']:focus + span::before {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[type='checkbox']:disabled + span:not(.lever),
input[type='radio']:disabled + span {
  color: var(--app-field-label);
}

input[type='range'] {
  margin: 8px 0;
  accent-color: var(--app-field-focus);
}

.range-field {
  margin: 4px 0;
}

.range-field .thumb {
  width: 22px;
  height: 22px;
  background-color: var(--app-field-focus);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.range-field .thumb .value {
  color: #fff;
  font-size: 10px;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
}

input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 999px;
}

input[type='range']::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: -5px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.file-field {
  margin-bottom: 0;
}

.file-field .btn,
.file-field .btn-large,
.file-field .btn-small {
  height: var(--app-field-height);
  line-height: var(--app-field-height);
  border-radius: var(--app-field-radius);
  text-transform: none;
  font-size: 12px;
  box-shadow: var(--app-field-shadow);
}

.file-field .btn i,
.file-field .btn-large i,
.file-field .btn-small i,
.file-field .btn .material-icons,
.file-field .btn-large .material-icons,
.file-field .btn-small .material-icons {
  font-size: 16px;
  line-height: inherit;
}

.file-field .file-path-wrapper {
  padding-left: 8px;
}

.file-field input.file-path {
  margin-bottom: 0;
}

/* Legacy Materialize-heavy personas create page: keep form layout stable with prefix + labels. */
.personas-create-page .card,
.personas-create-page .card-content {
  overflow: visible;
}

.personas-create-page .input-field {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
}

.personas-create-page .input-field > label {
  font-size: 10px;
  line-height: 1.2;
  background: transparent;
  padding: 0;
}

.personas-create-page .input-field > label.active {
  background: transparent;
  padding: 0;
  transform: translateY(-12px) scale(0.85);
}

.personas-create-page .input-field .prefix {
  width: 2rem;
  font-size: 16px;
  line-height: var(--app-field-height);
}

.personas-create-page .input-field .prefix ~ input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
.personas-create-page .input-field .prefix ~ textarea.materialize-textarea,
.personas-create-page .input-field .prefix ~ .select-wrapper,
.personas-create-page .input-field .prefix ~ .autocomplete-content {
  width: calc(100% - 2.2rem) !important;
  margin-left: 2.2rem !important;
}

.personas-create-page .input-field .prefix ~ label,
.personas-create-page .input-field .prefix ~ .helper-text {
  margin-left: 0;
  left: 2.2rem;
  width: calc(100% - 2.2rem);
  max-width: calc(100% - 2.2rem);
}

.personas-create-page .input-field .prefix ~ label.active {
  left: calc(2.2rem - 2px);
}

.personas-create-page .input-field .select-wrapper {
  display: block;
  width: calc(100% - 2.2rem);
  margin-left: 2.2rem;
}

.personas-create-page .input-field .select-wrapper input.select-dropdown {
  width: 100%;
}

.personas-create-page .input-field .select-wrapper.model-select-wrapper .model-select-logo {
  left: 10px;
}

.personas-create-page .input-field .select-wrapper.model-select-wrapper input.select-dropdown.has-model-logo {
  padding-left: 34px;
}

.personas-create-page .tabs .tab a {
  white-space: nowrap;
}

@media (max-width: 992px) {
  .personas-create-page .input-field .prefix {
    width: 1.8rem;
  }

  .personas-create-page .input-field .prefix ~ input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']):not(.select-dropdown),
  .personas-create-page .input-field .prefix ~ textarea.materialize-textarea,
  .personas-create-page .input-field .prefix ~ .select-wrapper,
  .personas-create-page .input-field .prefix ~ .autocomplete-content,
  .personas-create-page .input-field .select-wrapper {
    width: calc(100% - 2rem) !important;
    margin-left: 2rem !important;
  }

  .personas-create-page .input-field .prefix ~ label,
  .personas-create-page .input-field .prefix ~ .helper-text {
    left: 2rem;
    width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
  }

  .personas-create-page .input-field .prefix ~ label.active {
    left: calc(2rem - 2px);
  }
}

.select-wrapper {
  position: relative;
}

.select-wrapper input.select-dropdown {
  margin-bottom: 0;
  height: var(--app-field-height);
  line-height: var(--app-field-height);
  border: 1px solid var(--app-select-border);
  border-bottom: 1px solid var(--app-select-border);
  border-radius: var(--app-select-radius);
  background: var(--app-select-bg);
  color: var(--app-select-text);
  padding: 0 36px 0 12px;
  box-sizing: border-box;
  box-shadow: var(--app-field-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.select-wrapper input.select-dropdown:focus {
  border-color: var(--app-select-focus);
  border-bottom-color: var(--app-select-focus);
  box-shadow: 0 0 0 3px var(--app-select-focus-ring);
}

.select-wrapper.disabled input.select-dropdown,
.select-wrapper input.select-dropdown:disabled {
  background: var(--app-select-bg-muted);
  color: var(--app-select-muted);
  cursor: not-allowed;
  opacity: 0.9;
}

.select-wrapper .caret {
  fill: var(--app-select-muted);
  right: 12px;
  z-index: 2;
}

.input-field .select-wrapper + label {
  color: var(--app-field-label);
}

.dropdown-content.select-dropdown {
  border-radius: 16px;
  border: 1px solid var(--app-select-panel-border);
  background: var(--app-select-panel-bg);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
  padding: 6px;
  overflow-x: hidden;
}

.dropdown-content.select-dropdown li {
  min-height: 0;
  border-radius: 10px;
}

.dropdown-content.select-dropdown li > span {
  color: var(--app-select-text);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  line-height: 1.2;
  padding: 9px 12px;
}

.dropdown-content.select-dropdown li.disabled > span {
  color: var(--app-select-muted);
  opacity: 0.8;
}

.dropdown-content.select-dropdown li:hover,
.dropdown-content.select-dropdown li.active {
  background: var(--app-select-hover);
}

.dropdown-content.select-dropdown li.selected {
  background: var(--app-select-active);
}

.dropdown-content.select-dropdown li.selected > span {
  color: var(--app-select-text);
}

select.browser-default,
select.studio-native-select,
select[multiple] {
  border: 1px solid var(--app-select-border);
  border-radius: var(--app-select-radius);
  background: var(--app-select-bg);
  color: var(--app-select-text);
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

select.browser-default,
select.studio-native-select {
  min-height: var(--app-field-height);
  padding: 0 12px;
}

select[multiple] {
  min-height: 140px;
  padding: 8px 10px;
}

select.browser-default:focus,
select.studio-native-select:focus,
select[multiple]:focus {
  outline: none;
  border-color: var(--app-select-focus);
  box-shadow: 0 0 0 3px var(--app-select-focus-ring);
}

select.browser-default:disabled,
select.studio-native-select:disabled,
select[multiple]:disabled {
  background: var(--app-select-bg-muted);
  color: var(--app-select-muted);
  cursor: not-allowed;
}

.select-wrapper.model-select-wrapper {
  position: relative;
}

.select-wrapper.model-select-wrapper .model-select-logo {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--app-select-logo-size);
  height: var(--app-select-logo-size);
  border-radius: 5px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  padding: 1px;
  z-index: 2;
  pointer-events: none;
}

.select-wrapper.model-select-wrapper input.select-dropdown.has-model-logo {
  padding-left: 38px;
}

.dropdown-content.select-dropdown.model-select-dropdown li > span {
  gap: 10px;
}

.dropdown-content.select-dropdown.model-select-dropdown .model-select-option-logo {
  width: var(--app-select-logo-size);
  height: var(--app-select-logo-size);
  flex: 0 0 var(--app-select-logo-size);
  display: block;
  float: none;
  margin: 0;
  border-radius: 5px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  padding: 1px;
}

.app-card__title {
  font-family: var(--font-display);
  font-size: 14.4px;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.app-card__subtitle {
  margin: 0;
  color: var(--color-muted);
}

.app-username {
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.app-topbar .app-muted {
  color: rgba(255, 255, 255, 0.8);
}

.app-topbar .brand-logo {
  font-family: var(--font-display);
  font-weight: 700;
}

.app-topbar a {
  text-transform: none;
}

.app-hero {
  background: linear-gradient(120deg, #1e3a8a 0%, #9333ea 60%, #e11d48 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.app-hero h2 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.app-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.app-button {
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  padding: 0 22px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
  border: none;
  font-weight: 600;
  text-transform: none;
}

.app-button--accent {
  background: var(--color-accent);
}

.app-button--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(30, 58, 138, 0.3);
  box-shadow: none;
}

.app-button--small {
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
}

.btn-small,
.app-button--small {
  font-size: 12px;
}

.btn-small i,
.btn-small .material-icons,
.btn-small .material-symbols-outlined,
.app-button--small i,
.app-button--small .material-icons,
.app-button--small .material-symbols-outlined,
nav ul a.btn-small > .material-icons,
nav ul a.btn-small > .material-symbols-outlined {
  font-size: 12px;
}

.app-section-title {
  font-family: var(--font-display);
  font-size: 13.0px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.app-stat {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.app-stat h5 {
  font-size: 15.8px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-stat p {
  margin: var(--space-1) 0 0;
  color: var(--color-muted);
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.app-list__item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.app-list__item--stack {
  align-items: flex-start;
}

.app-list__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.app-list__title {
  font-weight: 600;
  margin: 0;
}

.app-list__subtitle {
  color: var(--color-muted);
  margin: 0;
  font-size: 9.4px;
}

.app-icon-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-icon-action {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #1e3a8a;
  background: #fff;
  transition: all .15s ease;
}

.app-icon-action:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.app-icon-action i,
.app-icon-action .material-icons,
.app-icon-action .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.app-icon-action.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.app-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-muted);
  font-size: 8.6px;
  font-weight: 600;
}

.app-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  background: var(--color-surface);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  height: 40px;
  box-shadow: var(--shadow-sm);
}

.app-search input {
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  height: 32px !important;
}

.app-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.app-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--color-muted);
  font-weight: 600;
  background: var(--color-surface);
}

.app-tabs a.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.app-table th,
.app-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  text-align: left;
}

.app-table th {
  font-size: 8.6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

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

.app-calendar th,
.app-calendar td {
  text-align: center;
}

.app-calendar .calendar-icon {
  height: 20px;
  width: auto;
}

.app-calendar .calendar-campaign-entry {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  border-radius: 8px;
  padding: 2px 5px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
}

.app-calendar .calendar-campaign-entry--start {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.app-calendar .calendar-campaign-entry--end {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.app-calendar .calendar-campaign-entry--middle {
  border-radius: 4px;
}

.app-calendar .calendar-campaign-badge {
  position: absolute;
  top: -8px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff;
}

.app-calendar .calendar-campaign-badge .material-symbols-outlined {
  font-size: 10px;
  line-height: 1;
}

.app-calendar .calendar-campaign-id-badge {
  position: absolute;
  right: -7px;
  bottom: -9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
}

.app-calendar .calendar-icon-symbol {
  font-size: 18px;
  color: #1e3a8a;
}

.app-calendar .calendar-empty {
  color: var(--color-muted);
}

.app-calendar .oggi {
  background: #e0e7ff;
  color: var(--color-primary);
  font-weight: 600;
}

.app-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-collapsible-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-collapsible {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.app-collapsible > li {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-collapsible > li:last-child {
  border-bottom: 0;
}

.app-collapsible .collapsible-header.app-collapsible-header {
  border-radius: var(--radius-lg);
}

.app-collapsible > li:first-child > .collapsible-header.app-collapsible-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0px 0px;
}

.app-collapsible > li:last-child > .collapsible-header.app-collapsible-header {
  border-radius: 0px 0px var(--radius-lg) var(--radius-lg);
}

.app-collapsible-delete {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-collapsible-delete .material-icons,
.app-collapsible-delete .material-symbols-outlined {
  font-size: 20px;
  line-height: 20px;
  width: 20px;
  height: 20px;
  margin-right: 0;
  color: #dc2626;
}

.campaign-visual-card {
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  background: #f8fbff;
  padding: var(--space-3);
}

.campaign-visual-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.campaign-visual-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 10px;
  font-weight: 600;
}

.campaign-json-surface {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: var(--space-2);
  max-height: 260px;
  overflow: auto;
}

.campaign-json-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campaign-json-tree__row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px 8px;
}

.campaign-json-tree__row--list {
  grid-template-columns: minmax(56px, 72px) 1fr;
}

.campaign-json-tree__key {
  color: #0f172a;
  font-weight: 600;
  font-size: 10px;
  word-break: break-word;
}

.campaign-json-tree__value {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.campaign-json-tree .campaign-json-tree {
  margin-top: 2px;
}

.campaign-json-tree .app-badge {
  width: fit-content;
}

.campaign-node-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.campaign-node-tree__item {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.campaign-node-tree__item--campaign {
  background: #eef6ff;
}

.campaign-node-tree__item--group {
  background: #f8fbff;
}

.campaign-node-tree__item--ad {
  background: #fdfefe;
}

.campaign-node-tree__children {
  list-style: none;
  margin: 10px 0 0 0;
  padding-left: 14px;
  border-left: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campaign-node-tree__title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.campaign-node-tree__name {
  margin: 8px 0 0 0;
  font-weight: 600;
  color: #0f172a;
}

@media (max-width: 640px) {
  .campaign-json-tree__row,
  .campaign-json-tree__row--list {
    grid-template-columns: 1fr;
  }
}

.app-card--scroll {
  overflow-x: auto;
}

.app-section-title--inline {
  margin: 0;
}

.post-republish-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
}

.post-republish-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.post-republish-actions i {
  font-size: 13.0px;
  color: var(--color-primary);
}

.app-pagination {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);
}

.app-pagination a,
.app-pagination span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 9.4px;
  color: var(--color-muted);
}

.app-pagination .is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}

.app-footer-spacer {
  height: 64px;
}

.plan-details-expandable {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
}

.plan-details-expandable[open] {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.plan-details-expandable__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 14px;
  cursor: pointer;
}

.plan-details-expandable__summary::-webkit-details-marker {
  display: none;
}

.plan-details-expandable__summary::after {
  content: 'expand_more';
  font-family: 'Material Icons';
  font-size: 20px;
  color: #475569;
  transition: transform .15s ease;
}

.plan-details-expandable[open] .plan-details-expandable__summary::after {
  transform: rotate(180deg);
}

.plan-details-expandable__content {
  padding: 2px 14px 14px;
}

.collection-post .post-plan-item {
  padding-right: 84px;
}

.collection-post .post-plan-title {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.collection-post .post-plan-touchpoint {
  margin: 4px 0 0;
}

.collection-post .post-plan-campaign-name {
  margin: 0 0 4px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}

.collection-post .secondary-content.post-plan-actions-stack {
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.collection-post .secondary-content.post-plan-actions-stack .post-republish-actions {
  margin-top: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.collection-post .secondary-content.post-plan-actions-stack form {
  margin: 0;
}

.collection-post .secondary-content.post-plan-actions-stack a,
.collection-post .secondary-content.post-plan-actions-stack button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .app-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-list__item {
    flex-direction: column;
    align-items: flex-start;
  }

  .collection-post .post-plan-item {
    padding-right: 80px;
  }

  .collection-post .secondary-content.post-plan-actions-stack {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .collection-post .secondary-content.post-plan-actions-stack .post-republish-actions {
    gap: 6px;
  }
}
