/* Rawesome Vets — Staff Portal Layout */
:root {
  --blue: #4269b0;
  --navy: #233c5b;
  --orange: #f5865b;
  --grey: #f4f1ed;
  --red: #ff7c7e;
  --teal: #8dd3ce;
  --sidebar-w: 248px;
}

/* ── READING PROGRESS ── */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(to right, var(--teal), var(--blue));
  z-index: 9999; transition: width 0.1s linear;
}

/* ── LAYOUT ── */
body { margin: 0; padding: 0 !important; background: #f7f6f3; }
.doc-page-wrap { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sb-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sb-back {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--teal); text-decoration: none;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.15s;
}
.sb-back:hover { color: #fff; }
.sb-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 13px; color: #fff;
  margin-top: 10px; line-height: 1.4;
}

.sb-section { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sb-section-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3); padding: 0 16px 5px; display: block;
}
.sb-category-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.2); padding: 8px 16px 3px; display: block;
  border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px;
}
.sb-category-label:first-child { border-top: none; margin-top: 0; }
.sb-link {
  display: block; padding: 7px 16px;
  font-size: 12px; color: rgba(255,255,255,0.65);
  text-decoration: none; line-height: 1.4;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}
.sb-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sb-link.active { color: #fff; background: rgba(66,105,176,0.35); border-left-color: var(--teal); }
.sb-link.soon { opacity: 0.38; pointer-events: none; }
.sb-link .sb-soon { font-size: 9px; background: rgba(255,255,255,0.1); border-radius: 8px; padding: 1px 5px; margin-left: 5px; color: rgba(255,255,255,0.35); }
.sb-sub {
  display: block; padding: 5px 16px 5px 26px;
  font-size: 11px; color: rgba(255,255,255,0.45);
  text-decoration: none; line-height: 1.4;
  transition: color 0.15s;
  border-left: 3px solid transparent;
}
.sb-sub:hover { color: rgba(255,255,255,0.85); }
.sb-sub.active { color: var(--teal); border-left-color: var(--teal); }

/* ── CONTENT WRAP ── */
.doc-content-wrap { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── TOPBAR ── */
.doc-topbar {
  background: #fff;
  border-bottom: 1px solid #e8e5e0;
  padding: 10px 32px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-toggle {
  display: none; background: none; border: none;
  cursor: pointer; font-size: 20px; color: var(--navy);
  padding: 2px 6px; line-height: 1;
}
.doc-breadcrumb { flex: 1; font-size: 11px; color: #999; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.doc-breadcrumb a { color: var(--blue); text-decoration: none; }
.doc-breadcrumb a:hover { text-decoration: underline; }
.doc-breadcrumb span { color: #ccc; }
.print-btn {
  background: none; border: 1px solid #ddd; border-radius: 4px;
  font-size: 11px; color: #888; cursor: pointer; padding: 4px 10px;
  white-space: nowrap; transition: border-color 0.15s, color 0.15s;
}
.print-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── DOC BODY ── */
.doc-body { padding: 32px 40px 48px; max-width: 820px; flex: 1; }

/* ── FOOTER NAV ── */
.doc-footer-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px 40px; border-top: 1px solid #e8e5e0;
  max-width: 820px;
}
.doc-footer-nav a {
  color: var(--blue); text-decoration: none; font-size: 13px;
  font-weight: 600; display: flex; align-items: center; gap: 5px;
}
.doc-footer-nav a:hover { text-decoration: underline; }
.doc-footer-nav a.disabled { color: #ccc; pointer-events: none; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 199;
}
.sidebar-overlay.visible { display: block; }

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 38px; height: 38px;
  background: var(--navy); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; text-decoration: none;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 150;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--blue); transform: translateY(-2px); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  .doc-content-wrap { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .doc-topbar { padding: 10px 16px; }
  .doc-body { padding: 20px 16px 40px; }
  .doc-footer-nav { padding: 16px 16px 32px; }
}

/* ── AUDIENCE TAGS ── */
.audience-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 20px; }
.audience-tag {
  padding: 3px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  display: inline-block;
}
.tag-all { background: var(--navy); color: #fff; }
.tag-nursing { background: var(--teal); color: var(--navy); }
.tag-vets { background: var(--blue); color: #fff; }
.tag-manager { background: var(--red); color: #fff; }
.tag-kennel { background: var(--orange); color: #fff; }

/* ── CATEGORY TAGS ── */
.category-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.category-tag {
  padding: 3px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  display: inline-block;
}
.tag-cat-reception { background: #dde8f8; color: #1a4a8f; }
.tag-cat-admin     { background: #e8e8ea; color: #3d4457; }
.tag-cat-surgery   { background: #fde8e8; color: #a32424; }
.tag-cat-medicine  { background: #e4f5eb; color: #1f6e39; }
.tag-cat-boarding  { background: #fef2e4; color: #8c4a00; }
.tag-cat-billing   { background: #fef8d8; color: #7d5a00; }
.tag-cat-kennel    { background: #ede8f5; color: #5c3a8c; }

/* ── SIGN-OFF ── */
.signoff-section { border-top: 2px solid #e8e5e0; margin-top: 40px; padding-top: 24px; }
.signoff-intro { font-size: 12px; color: #666; margin-bottom: 12px; }
.signoff-form-wrap { background: var(--grey); border-left: 4px solid var(--teal); padding: 16px 20px; border-radius: 0 4px 4px 0; display: inline-block; min-width: 300px; }
.signoff-form label { display: block; font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.signoff-form input[type="text"] {
  display: block; width: 100%; max-width: 280px;
  padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px;
  font-size: 13px; font-family: Inter, Arial, sans-serif;
  box-sizing: border-box; margin-bottom: 12px;
}
.signoff-form input[type="text"]:focus { outline: none; border-color: var(--blue); }
.signoff-btn {
  background: var(--blue); color: #fff; border: none;
  padding: 9px 22px; border-radius: 4px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: Inter, Arial, sans-serif; transition: background 0.15s;
}
.signoff-btn:hover { background: #3558a0; }
.signoff-btn:disabled { background: #aaa; cursor: not-allowed; }
.signoff-confirm {
  display: none; background: #e8f4ff; border-left: 4px solid var(--blue);
  padding: 12px 16px; border-radius: 0 4px 4px 0;
  font-size: 12px; color: var(--navy); max-width: 360px;
}

/* ── PRINT ── */
@media print {
  #reading-progress, #sidebar, .sidebar-overlay, .sidebar-toggle,
  .back-to-top, .print-btn, .doc-footer-nav,
  .audience-tags, .category-tags, .signoff-section { display: none !important; }
  .doc-content-wrap { margin-left: 0 !important; }
  .doc-topbar { position: static; box-shadow: none; border: none; }
  .doc-body { padding: 0; max-width: none; }
}
