/* === base.css === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #1B4F8A;
  --blue-light: rgba(27,79,138,.08);
  --green:      #0F6E56;
  --green-light:rgba(15,110,86,.07);
  --red:        #A32D2D;
  --red-light:  rgba(163,45,45,.08);
  --amber:      #854F0B;
  --bg:         #ffffff;
  --bg2:        #f7f7f6;
  --bg3:        #f0efed;
  --text:       #1a1a18;
  --text2:      #5f5e5a;
  --text3:      #888780;
  --border:     rgba(0,0,0,.12);
  --border2:    rgba(0,0,0,.22);
  --radius:     8px;
  --radius-lg:  12px;
  --topbar-h:   52px;
  --sidebar-w:  210px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:    #1c1c1a;
    --bg2:   #252523;
    --bg3:   #2c2c2a;
    --text:  #f0efed;
    --text2: #b4b2a9;
    --text3: #888780;
    --border:  rgba(255,255,255,.12);
    --border2: rgba(255,255,255,.22);
  }
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg3); }

#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  transition: margin-right .25s;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg3);
}

/* Sections */
.section { display: none; }
.section.active { display: block; }

.section-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

/* Cards */
.card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

/* Grid rows */
.row { display: grid; gap: 12px; margin-bottom: 10px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text2); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 6px 8px;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s;
}

.field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-light);
}

.field input[readonly] { background: var(--bg2); cursor: default; }

/* IA-filled highlight */
.ai-filled { border-color: var(--green) !important; background: var(--green-light) !important; }

/* Nav between sections */
.section-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
