:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;
  --color-accent: #d92d20;
  --color-accent-soft: #fef2f2;
  --color-hero-from: #1e3a5f;
  --color-hero-to: #0f1f33;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 220px;
  background-image:
    linear-gradient(135deg, rgba(30, 58, 95, 0.85), rgba(15, 31, 51, 0.85)),
    url("https://images.unsplash.com/photo-1521791136064-7986c2920216?auto=format&fit=crop&w=2000&q=70");
  background-size: cover;
  background-position: center;
  color: #fff;
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.55), rgba(15, 31, 51, 0.35));
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero__badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(217, 45, 32, 0.35);
  flex-shrink: 0;
}

.hero__title {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  margin: 0;
  font-size: 15px;
  opacity: 0.85;
  font-weight: 400;
}

/* ---------- Layout ---------- */

.container {
  max-width: 1120px;
  margin: -40px auto 48px;
  padding: 0 32px;
  position: relative;
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 480px;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */

.sidebar {
  padding: 20px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.doc-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.doc-card.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.doc-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.doc-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-card__icon svg {
  width: 18px;
  height: 18px;
}

.doc-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.doc-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}

.doc-card__desc {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ---------- Viewer ---------- */

.viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-height: 480px;
}

.viewer__empty {
  text-align: center;
  max-width: 360px;
}

.viewer__empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  background: #f3f4f6;
  color: var(--color-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer__empty-icon svg {
  width: 26px;
  height: 26px;
}

.viewer__empty-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.viewer__empty-text {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.viewer__frame {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: 0;
  border-radius: var(--radius-sm);
}

.viewer:has(.viewer__frame:not([hidden])) {
  padding: 0;
  align-items: stretch;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .hero__inner {
    padding: 40px 20px;
  }
  .hero__title {
    font-size: 26px;
  }
  .container {
    padding: 0 16px;
    margin-top: -28px;
  }
  .panel {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .viewer {
    min-height: 360px;
  }
  .viewer__frame {
    min-height: 360px;
  }
}
