:root {
  --bg: #f8f7f4;
  --panel: #ffffff;
  --panel-soft: #f8f7f4;
  --ink: #0b1f3a;
  --muted: #5f6b7a;
  --line: #d9dee7;
  --accent: #e9b82a;
  --accent-dark: #c99512;
  --navy: #0b1f3a;
  --navy-light: #162d52;
  --red: #b34f45;
  --shadow: 0 18px 44px rgba(11, 31, 58, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--navy);
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  font-weight: 800;
}

.brand p,
.sidebar-note p {
  color: #dfe5ee;
  font-size: 13px;
  line-height: 1.45;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  text-align: left;
  color: #eef2f7;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(233, 184, 42, 0.45);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.note-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--navy-light);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar h2 {
  max-width: 820px;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}

.topbar-actions,
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-btn {
  background: var(--navy);
  color: white;
  border-color: var(--accent);
}

.primary-btn:hover {
  background: var(--navy-light);
}

.ghost-btn,
.icon-btn {
  background: white;
  color: var(--ink);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--accent);
  background: #fffbf0;
}

.danger {
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

.panel-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.panel-heading h3 {
  font-size: 19px;
  font-weight: 700;
}

.panel-heading p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.meeting-form {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #33413b;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 280px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 184, 42, 0.22);
}

.file-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px dashed #aab8b0;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 14px;
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.metrics span {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}

.metrics p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 8px;
  font-weight: 800;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  min-height: 330px;
}

.tab-content.active {
  display: block;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 24px;
}

.item-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-item,
.history-item,
.template-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.insight-item strong {
  display: block;
  margin-bottom: 5px;
}

.insight-item p,
.history-item p,
.template-item p {
  color: var(--muted);
  line-height: 1.5;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.tag {
  border-radius: 999px;
  background: #edf2f8;
  color: var(--navy-light);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.tag.warn {
  background: #fff4cf;
  color: #8d6505;
}

.tag.risk {
  background: #fdecea;
  color: var(--red);
}

.minutes {
  white-space: pre-wrap;
  line-height: 1.55;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.history-item {
  display: grid;
  gap: 8px;
}

.history-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.history-item h4,
.template-item h4 {
  margin: 0;
}

.history-item button {
  justify-self: start;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.template-code {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #f7fbf8;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .input-grid,
  .template-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-heading.compact,
  .history-item header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .field-row,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .result-actions {
    width: 100%;
  }

  .primary-btn,
  .ghost-btn,
  .icon-btn {
    flex: 1;
  }
}
