/* style.css — tema aproximado do SAP Fiori (Horizon theme) */

:root {
  --sap-brand: #0854A0;
  --sap-brand-hover: #0a6ed1;
  --sap-bg: #f5f6f7;
  --sap-shell-bg: #354a5f;
  --sap-tile-bg: #ffffff;
  --sap-border: #d9d9d9;
  --sap-text: #32363a;
  --sap-text-muted: #6a6d70;
  --sap-success: #257a3e;
  --sap-error: #b00;
  --sap-error-bg: #ffebeb;
  --sap-warning-bg: #fef7e5;
  --sap-warning-text: #8f6400;
  --sap-critical-border: #e9730c;
  --font: "72", "72full", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--sap-bg);
  color: var(--sap-text);
  font-size: 14px;
}

/* Shell bar, como o topo do Fiori Launchpad */
.shell-bar {
  background: var(--sap-shell-bg);
  color: #fff;
  padding: 0 1rem;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shell-bar__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.shell-bar__meta {
  font-size: 12px;
  opacity: 0.85;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

/* Object page header, como cabeçalho de transação */
.scenario-header {
  background: var(--sap-tile-bg);
  border: 1px solid var(--sap-border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.scenario-header__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sap-text-muted);
  margin-bottom: 0.25rem;
}

.scenario-header__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.briefing-box {
  background: #fafafa;
  border-left: 3px solid var(--sap-brand);
  padding: 0.75rem 1rem;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.analogia-box {
  background: var(--sap-warning-bg);
  border-left: 3px solid var(--sap-critical-border);
  padding: 0.75rem 1rem;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sap-warning-text);
}

.analogia-box__label {
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

/* Tabs, como Header / Item Overview / Item Detail */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--sap-border);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.6rem 1rem;
  font-size: 13px;
  color: var(--sap-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: default;
}

.tab.active {
  color: var(--sap-brand);
  border-bottom-color: var(--sap-brand);
  font-weight: 600;
}

.tab.disabled {
  opacity: 0.4;
}

/* Form / campos de tela */
.field-panel {
  background: var(--sap-tile-bg);
  border: 1px solid var(--sap-border);
  border-radius: 4px;
  padding: 1.25rem;
}

.field-panel__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--sap-text);
}

.field-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.field-row label {
  font-size: 13px;
  color: var(--sap-text-muted);
}

.field-row input,
.field-row select {
  font-family: var(--font);
  font-size: 13px;
  padding: 0.4rem 0.5rem;
  border: 1px solid #89919a;
  border-radius: 4px;
  background: #fff;
  color: var(--sap-text);
}

.field-row input:focus,
.field-row select:focus {
  outline: none;
  border-color: var(--sap-brand);
  box-shadow: 0 0 0 1px var(--sap-brand);
}

.field-row input.prefilled {
  background: #f2f2f2;
  color: var(--sap-text-muted);
}

.field-row .field-hint {
  grid-column: 2;
  font-size: 11px;
  color: var(--sap-text-muted);
  margin-top: -0.4rem;
}

.field-critico {
  border-color: var(--sap-critical-border) !important;
}

/* Botões */
.btn-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

button {
  font-family: var(--font);
  font-size: 13px;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--sap-brand);
  background: #fff;
  color: var(--sap-brand);
  cursor: pointer;
}

button.primary {
  background: var(--sap-brand);
  color: #fff;
}

button.primary:hover {
  background: var(--sap-brand-hover);
  border-color: var(--sap-brand-hover);
}

button:hover {
  background: #eaf2fb;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mensagens de sistema, como a message bar do Fiori */
.msg-bar {
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  font-size: 13px;
  margin-bottom: 1rem;
  display: none;
}

.msg-bar.show { display: block; }

.msg-bar.success {
  background: #eafae2;
  color: var(--sap-success);
  border-left: 3px solid var(--sap-success);
}

.msg-bar.error {
  background: var(--sap-error-bg);
  color: var(--sap-error);
  border-left: 3px solid var(--sap-error);
}

.msg-bar.info {
  background: #eaf2fb;
  color: var(--sap-brand);
  border-left: 3px solid var(--sap-brand);
}

/* Documento gerado, como o toast/confirmação de PO criado */
.doc-badge {
  display: inline-block;
  background: #eaf2fb;
  color: var(--sap-brand);
  border: 1px solid var(--sap-brand);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 12px;
  font-weight: 600;
  font-family: monospace;
}

/* Painel de explicação de erro em cascata */
.cascata-box {
  background: var(--sap-error-bg);
  border: 1px solid var(--sap-error);
  border-radius: 4px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 13px;
  line-height: 1.5;
}

.cascata-box__label {
  font-weight: 700;
  color: var(--sap-error);
  display: block;
  margin-bottom: 0.4rem;
}

.progress-track {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.progress-step {
  flex: 1;
  height: 4px;
  background: var(--sap-border);
  border-radius: 2px;
}

.progress-step.done { background: var(--sap-success); }
.progress-step.current { background: var(--sap-brand); }

.field-with-f4 {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.field-with-f4 input {
  flex: 1;
}

.btn-f4 {
  border: 1px solid #89919a;
  background: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}

.btn-f4:hover {
  background: #eaf2fb;
  border-color: var(--sap-brand);
}

.f4-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.f4-overlay.show {
  display: flex;
}

.f4-panel {
  background: #fff;
  border-radius: 4px;
  width: 90%;
  max-width: 480px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.f4-panel__header {
  background: var(--sap-shell-bg);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.f4-fechar {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}

.f4-lista {
  overflow-y: auto;
  padding: 0.4rem 0;
}

.f4-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

.f4-item:hover {
  background: #eaf2fb;
}

.f4-item__valor {
  font-family: monospace;
  font-weight: 700;
  color: var(--sap-brand);
  min-width: 70px;
}

.f4-item__desc {
  color: var(--sap-text);
}

@media (max-width: 600px) {
  .field-row {
    grid-template-columns: 1fr;
  }
  .field-row .field-hint {
    grid-column: 1;
  }
}
