:root {
  --bg: #f2efe6;
  --surface: #fffdf7;
  --surface-soft: #f7f1e4;
  --ink: #1c1a16;
  --ink-soft: #5c564a;
  --line: #d8ceb8;
  --accent: #0b6c78;
  --accent-2: #d95f00;
  --danger: #ba1f1f;
  --shadow: 0 10px 30px rgba(28, 26, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 20% -20%, #efe6d1 0%, transparent 70%),
    radial-gradient(800px 400px at 90% 20%, #e6f0ea 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-brand {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
}

.login-card h1 {
  margin-top: 8px;
  margin-bottom: 8px;
}

.login-card p {
  margin-top: 0;
  color: var(--ink-soft);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
}

button {
  border: none;
  border-radius: 11px;
  background: linear-gradient(120deg, var(--accent), #05666f);
  color: #fff;
  font-weight: 700;
  padding: 11px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
}

.error {
  color: var(--danger);
  min-height: 16px;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbf7ec 0%, #f5efdf 100%);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.logo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: linear-gradient(135deg, #0b6c78, #d95f00);
  color: #fff;
}

.logo-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 11px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
}

.menu {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

.menu-item {
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
}

.menu-item.active {
  border-color: #1b8a98;
  box-shadow: 0 0 0 2px rgba(11, 108, 120, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.current-user {
  font-size: 13px;
  color: var(--ink-soft);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.content {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.content-header {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(100deg, #fffdf8, #fdf6eb);
  padding: 18px;
}

.content-header p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.section-panel {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0 auto 0 0;
}

.stack {
  display: grid;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  font-size: 13px;
}

th {
  color: var(--ink-soft);
  font-weight: 700;
}

.muted {
  color: var(--ink-soft);
  font-size: 13px;
}

.report-output {
  margin: 0;
  padding: 10px;
  min-height: 180px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.assistant-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  background: #fffcf4;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(21, 26, 28, 0.18);
  overflow: hidden;
}

.assistant-widget header {
  padding: 11px 12px;
  background: linear-gradient(140deg, #0d7c87, #155960);
  color: #f7ffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assistant-widget header p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.assistant-widget .badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 3px 9px;
}

.assistant-body {
  padding: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.assistant-widget footer {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.assistant-widget input {
  width: 100%;
  border: 1px dashed var(--line);
  background: #fff;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .assistant-widget {
    position: static;
    margin: 0 12px 12px;
    width: auto;
  }
}
