/* ============================================================
   CT04 "Change Characteristic" — SAP screen layout styles.
   Reuses sap-ui.css tokens and classes where possible.
   Adds .sap-ct04-* classes only for genuinely new structure.
   ============================================================ */

/* ── Window grid (titlebar 32 | toolbar 36 | body 1fr | statusbar 28) ─── */
.sap-ct04-window {
  grid-template-rows: 32px 36px 1fr 28px;
}

/* ── Toolbar ───────────────────────────────────────────────────────────── */
.sap-ct04-toolbar {
  padding: 0 8px;
  gap: 4px;
}
.sap-ct04-char-select {
  height: 24px;
  border: 1px solid var(--sap-cmd-border);
  font-size: 12px;
  padding: 0 6px;
  background: var(--sap-cmd-bg);
  color: var(--sap-text);
  border-radius: 2px;
  min-width: 80px;
}
.sap-ct04-more {
  font-size: 12px;
  color: var(--sap-text);
  cursor: default;
  margin-right: 8px;
}

/* ── Body column (header + tabs + tab-body) ────────────────────────────── */
.sap-ct04-body {
  background: var(--sap-body-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header block ──────────────────────────────────────────────────────── */
.sap-ct04-header {
  padding: 8px 16px 4px 16px;
  border-bottom: 1px solid var(--sap-toolbar-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.sap-ct04-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sap-ct04-char-row {
  gap: 8px;
}

/* ── Field labels in header / form rows ────────────────────────────────── */
.sap-ct04-field-label {
  font-size: 12px;
  color: var(--sap-text);
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
}

/* For Basic data group, labels are shorter */
.sap-ct04-basic-grid .sap-ct04-field-label,
.sap-ct04-format-grid .sap-ct04-field-label,
.sap-ct04-value-grid  .sap-ct04-field-label {
  min-width: 100px;
  text-align: right;
}

/* ── Characteristic input field ────────────────────────────────────────── */
.sap-ct04-char-field-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  height: 22px;
  border-radius: 2px;
  width: 220px;
  transition: border-color 120ms, box-shadow 120ms;
}
.sap-ct04-char-field-active {
  border-color: var(--sap-cmd-border-focus);
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.18);
}
.sap-ct04-char-input {
  border: 0;
  background: transparent;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 0 6px;
  width: 100%;
  color: var(--sap-text);
  outline: none;
  text-transform: uppercase;
}
.sap-ct04-char-input.correct {
  background: #e8f5ec;
  color: #0a6e3a;
}
.sap-ct04-char-input.incorrect {
  background: #fbeae8;
  color: #a52a1f;
  animation: shake 500ms ease-out;
}

/* ── Action icon buttons (display/edit/copy/transport/delete row) ───────── */
.sap-ct04-char-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}
.sap-ct04-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  background: var(--sap-cmd-bg);
  border: 1px solid var(--sap-cmd-border);
  border-radius: 2px;
  font-size: 12px;
  color: var(--sap-text);
  cursor: default;
}
.sap-ct04-action-btn:hover {
  background: #eef2f6;
}

/* ── Small inputs (Change Number, Valid From) ───────────────────────────── */
.sap-ct04-small-input {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 12px;
  padding: 0 6px;
  border-radius: 2px;
  width: 130px;
  outline: none;
  font-family: 'Consolas', 'Courier New', monospace;
  color: var(--sap-text);
}
.sap-ct04-date-input {
  width: 90px;
}
.sap-ct04-validity-btn {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 12px;
  padding: 0 14px;
  border-radius: 2px;
  color: var(--sap-text);
  cursor: default;
  margin-left: 6px;
}
.sap-ct04-validity-btn:hover {
  background: #eef2f6;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.sap-ct04-tabs {
  flex-shrink: 0;
}

/* ── Tab body (the scrollable content area under the tabs) ─────────────── */
.sap-ct04-tab-body {
  flex: 1;
  overflow-y: auto;
  background: #f5f6f7;
  padding: 12px 16px;
}

/* ── Three-column groups row ────────────────────────────────────────────── */
.sap-ct04-groups-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* ── Individual group box ───────────────────────────────────────────────── */
.sap-ct04-group {
  background: var(--sap-body-bg);
  border: 1px solid var(--sap-toolbar-border);
  border-radius: 2px;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.sap-ct04-group:first-child  { min-width: 280px; }
.sap-ct04-group:nth-child(2) { min-width: 260px; }
.sap-ct04-group:last-child   { min-width: 180px; }

.sap-ct04-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--sap-text);
  padding: 6px 10px 4px 10px;
  border-bottom: 1px solid var(--sap-toolbar-border);
  background: #f1f3f6;
  border-radius: 2px 2px 0 0;
}
.sap-ct04-group-content {
  padding: 8px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Form row (label + input, one per line) ─────────────────────────────── */
.sap-ct04-form-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Inline inputs used in the form groups ──────────────────────────────── */
.sap-ct04-input {
  height: 20px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 12px;
  padding: 0 5px;
  border-radius: 2px;
  outline: none;
  color: var(--sap-text);
  font-family: inherit;
}
.sap-ct04-select {
  height: 20px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 12px;
  padding: 0 4px;
  border-radius: 2px;
  color: var(--sap-text);
}
.sap-ct04-input-tiny   { width: 50px; }
.sap-ct04-input-medium { width: 120px; }
.sap-ct04-input-long   { width: 170px; }

/* ── Required asterisk ──────────────────────────────────────────────────── */
.sap-ct04-required {
  color: #d34c2f;
  font-weight: 600;
}

/* ── Translation icon row (inside Basic data group) ─────────────────────── */
.sap-ct04-translation-icons {
  display: flex;
  gap: 4px;
  padding: 4px 10px 8px 10px;
}

/* ── Value assignment group ─────────────────────────────────────────────── */
.sap-ct04-value-grid {
  gap: 4px;
}
.sap-ct04-radio-row,
.sap-ct04-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sap-ct04-radio-row {
  margin-bottom: 2px;
}
.sap-ct04-check-label {
  font-size: 12px;
  color: var(--sap-text);
}
.sap-ct04-check-row input[type="checkbox"],
.sap-ct04-radio-row input[type="radio"] {
  cursor: default;
  accent-color: var(--sap-link);
  width: 14px;
  height: 14px;
}
