:root {
  --ink: #18202b;
  --muted: #687386;
  --line: #dce3eb;
  --panel: #ffffff;
  --bg: #f4f7fa;
  --brand: #163b63;
  --brand-2: #0e7a8a;
  --accent: #d7b56d;
  --danger: #b42318;
  --success: #047857;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  background: var(--brand);
  color: white;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
}

button:hover {
  background: #0f2d4d;
}

button.secondary {
  color: var(--brand);
  background: #e8f0f7;
}

button.ghost {
  color: #cbd6e2;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

button.small {
  min-height: 32px;
  padding: 6px 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 10px 11px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef4f8 0%, #f8fafc 55%, #edf7f7 100%);
}

.login-card {
  width: min(440px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(24, 32, 43, 0.08);
}

.login-card h1 {
  margin-top: 16px;
  font-size: 28px;
}

.login-card p {
  margin: 8px 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

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

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

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

.sidebar {
  background: #101b29;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
}

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

.sidebar-brand span {
  display: block;
  color: #a8b5c4;
  margin-top: 2px;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #cbd6e2;
}

.nav.active,
.nav:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

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

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

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(520px, 1.2fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 220px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.list {
  display: grid;
}

.request-row {
  text-align: left;
  color: var(--ink);
  background: white;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.request-row:hover {
  background: #f8fbfd;
}

.request-row strong {
  display: block;
  margin-bottom: 5px;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef4f8;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.detail-panel {
  padding: 16px;
}

.empty-state {
  color: var(--muted);
  padding: 40px;
  text-align: center;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-head p {
  color: var(--muted);
  margin-top: 4px;
}

.raw-box {
  white-space: pre-wrap;
  max-height: 160px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: #445063;
  margin: 12px 0;
}

.line-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.line-card .form-grid {
  grid-template-columns: 90px repeat(3, minmax(120px, 1fr));
}

.line-card textarea {
  min-height: 78px;
}

.line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.link-row a {
  color: var(--brand-2);
  font-weight: 700;
}

.form-panel {
  padding: 20px;
}

.form-panel form {
  display: grid;
  gap: 16px;
}

.form-panel h3 {
  margin-bottom: 16px;
}

.form-panel h4 {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
}

.quote-box {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.success {
  color: var(--success);
  min-height: 18px;
}

.followup-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.followup-card {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.followup-card.done {
  opacity: 0.58;
}

.followup-card h3 {
  margin: 8px 0 4px;
}

.followup-card p {
  color: var(--muted);
  margin-bottom: 10px;
}

.followup-actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

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

  .sidebar {
    position: static;
  }

  .grid-two,
  .form-grid,
  .quote-box,
  .followup-card,
  .line-card .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
