* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --border: #dbe3ee;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #eef2ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

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

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

.sidebar {
  background: #0f172a;
  color: #fff;
  padding: 24px 20px;
}

.logo {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 32px;
}

.logo h2 {
  margin: 0;
  font-size: 20px;
}

.logo p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 13px;
}

.logo-badge {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  font-weight: bold;
  font-size: 18px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  border: none;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.main {
  padding: 28px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.content-section {
  display: none;
}

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

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 20px;
}

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

.form-group {
  display: grid;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
  margin-top: 12px;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fafcff;
}

.item-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.item-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}

.protocol-preview {
  min-height: 300px;
  background: #fafcff;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
}

.protocol-sheet h4 {
  margin-top: 0;
  margin-bottom: 16px;
}

.protocol-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.protocol-row:last-child {
  border-bottom: none;
}

.muted {
  color: var(--muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

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

  .sidebar {
    padding: 18px;
  }

  .main {
    padding: 18px;
  }

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

@media print {
  body * {
    visibility: hidden;
  }

  #protocolPreview,
  #protocolPreview * {
    visibility: visible;
  }

  #protocolPreview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    background: #fff;
  }
}
