:root {
  --color-input-bg: #ffffff;
  --color-input-border: #d7dbe7;
  --color-input-border-hover: #bbc3d4;
  --color-input-border-focus: #2b8bd3;
  --color-input-shadow-focus: rgba(43, 139, 211, 0.14);
  --color-input-label: #4b5563;
  --color-input-text: #0f1724;
  --color-input-placeholder: #9ca3af;
  --color-input-disabled-bg: #f0f2f8;
  --color-input-disabled-text: #9aa3b9;
  --control-radius: 10px;
  --control-padding-y: 5px;
  --control-padding-x: 10px;
  --control-min-height: 25px;
}

.input-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 22px 0;
}

.input-field label {
  position: static;
  transform: none !important;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-input-label);
  margin: 0;
}

.input-field label.active {
  color: var(--color-input-label);
}

.input-field input,
.input-field textarea,
.input-field select,
.input-field .select-wrapper input.select-dropdown,
.form-control {
  width: 100%;
  padding: var(--control-padding-y) var(--control-padding-x) !important;
  border-radius: var(--control-radius) !important;
  border: 1px solid var(--color-input-border) !important;
  background-color: var(--color-input-bg) !important;
  color: var(--color-input-text) !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: var(--control-min-height) !important;
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-field textarea,
textarea.form-control {
  resize: vertical;
  min-height: 50px !important;
}

.form-control--sm {
  min-height: calc(var(--control-min-height) - 4px) !important;
  padding: 4px 9px !important;
}

.input-field select,
.input-field .select-wrapper input.select-dropdown,
.form-control.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.41.59L6 5.17 10.59.59 12 2l-6 6-6-6L1.41.59z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 42px !important;
}

.input-field input:hover,
.input-field textarea:hover,
.input-field select:hover,
.input-field .select-wrapper input.select-dropdown:hover,
.form-control:hover {
  border-color: var(--color-input-border-hover) !important;
  background-color: var(--color-input-bg) !important;
}

.input-field input:focus,
.input-field textarea:focus,
.input-field select:focus,
.input-field .select-wrapper input.select-dropdown:focus,
.form-control:focus {
  border-color: var(--color-input-border-focus) !important;
  box-shadow: 0 0 0 4px var(--color-input-shadow-focus) !important;
  outline: none;
  background-color: #fff;
}

.input-field input::placeholder,
.input-field textarea::placeholder,
.form-control::placeholder {
  color: var(--color-input-placeholder);
  opacity: 1;
}

.input-field input:disabled,
.input-field textarea:disabled,
.input-field select:disabled,
.input-field .select-wrapper input.select-dropdown:disabled,
.form-control:disabled {
  background-color: var(--color-input-disabled-bg) !important;
  color: var(--color-input-disabled-text) !important;
  border-color: transparent !important;
  cursor: not-allowed;
}

.input-field .helper-text {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-input-label);
}

.input-field .helper-text[data-error],
.input-field .helper-text.invalid,
.input-field input.invalid,
.input-field textarea.invalid,
.input-field select.invalid {
  color: #c0392b !important;
  border-color: #c0392b !important;
  box-shadow: none !important;
}

select.browser-default {
  display: block;
  width: 100%;
  border-radius: var(--control-radius) !important;
  border: 1px solid var(--color-input-border) !important;
  padding: var(--control-padding-y) var(--control-padding-x) !important;
  min-height: var(--control-min-height) !important;
  background-color: var(--color-input-bg) !important;
  color: var(--color-input-text) !important;
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

select.browser-default:focus {
  border-color: var(--color-input-border-focus) !important;
  box-shadow: 0 0 0 4px var(--color-input-shadow-focus) !important;
  outline: none;
}

select.browser-default:disabled {
  background-color: var(--color-input-disabled-bg) !important;
  color: var(--color-input-disabled-text) !important;
  border-color: transparent !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--color-input-bg) inset !important;
  -webkit-text-fill-color: var(--color-input-text) !important;
  border-radius: var(--control-radius) !important;
  border: 1px solid var(--color-input-border) !important;
}

.field-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-min-height);
  margin: 0 0 16px 0;
}

.field-actions .btn {
  width: 100%;
}

.app-form .row::after {
  content: "";
  display: table;
  clear: both;
}

.app-form .row {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  margin-bottom: 26px;
}

.app-form .row.row-tight {
  margin-bottom: 10px;
}

.app-form .row.row-tight:last-child {
  margin-bottom: 0;
}

.app-form .row:last-child {
  margin-bottom: 0;
}

.app-form .row .col {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-sizing: border-box;
}

.app-form .card.card-modern {
  padding: 1.5rem;
}

.app-form .card.card-modern .card-content {
  padding: 0;
}

.app-form .card.card-modern.card-nested {
  padding: 0;
  margin-bottom: 18px;
  border: 1px solid rgba(38, 50, 56, 0.24);
  background-color: #fff;
  border-radius: var(--control-radius);
  overflow: hidden;
}

.app-form .card.card-modern.card-nested:last-child {
  margin-bottom: 0;
}

.app-form .card.card-modern.card-nested .nested-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(38, 50, 56, 0.12);
  background-color: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.app-form .card.card-modern.card-nested .nested-card-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.app-form .card.card-modern.card-nested .nested-card-index {
  font-weight: 600;
}

.app-form .card.card-modern.card-nested .nested-card-name {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
}

.app-form .card.card-modern.card-nested .nested-card-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.app-form .card.card-modern.card-nested .nested-card-actions .btn {
  min-width: 0;
  padding: 0.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-form .card.card-modern.card-nested .nested-card-actions .material-icons {
  font-size: 18px;
}

.app-form .card.card-modern.card-nested .nested-card-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: inherit;
}

.app-form .card.card-modern.card-nested .nested-card-toggle:focus-visible {
  outline: 2px solid rgba(43, 139, 211, 0.4);
  outline-offset: 2px;
}

.app-form .card.card-modern.card-nested .nested-card-header .material-icons {
  font-size: 20px;
}

.app-form .card.card-modern.card-nested .nested-card-body {
  padding: 1.5rem;
}

.app-form .card.card-modern.card-nested.is-collapsed .nested-card-body {
  display: none;
}

.app-form .card.card-modern.card-nested.is-collapsed .nested-card-header {
  border-bottom: none;
}

.line .line-extra {
  margin-top: 1rem;
}

.line .line-extra .options-container {
  padding: 0;
}

.line .line-extra .options-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.line .line-extra .options-stack .row {
  margin-bottom: 0;
}

.line .line-extra .options-stack .options-row {
  row-gap: 18px;
}

.app-form .card.card-modern .nested-card-body .line-extra .options-stack .input-field {
  margin-bottom: 16px;
}

.app-form .card.card-modern .nested-card-body .line-extra .options-stack .input-field:last-child {
  margin-bottom: 0;
}

#add-line,
#add-custom-line {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-form .card.card-modern .card-content > .row {
  margin-left: 0;
  margin-right: 0;
}

.app-form .card.card-modern .card-content > .row .col:not(:last-child) {
  padding-right: 1rem;
}

.app-form .card.card-modern .card-content > .row .col:not(:first-child) {
  padding-left: 1rem;
}

.app-form .card.card-modern .card-content > .row:last-child .input-field,
.app-form .card.card-modern .card-content > :last-child .row:last-child .input-field {
  margin-bottom: 0;
}

.table-modern tbody .form-control,
.table-modern tbody input,
.table-modern tbody select {
  width: 100%;
  margin: 0;
}

.table-modern td.table-input {
  padding-top: 16px;
  padding-bottom: 16px;
}

.table-modern td.table-input .helper-text {
  margin-top: 6px;
  display: block;
}
