:root {
  --bg: #e9eff5;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --line: #e2e8f0;
  --accent: #0ea5e9;
  --accent-2: #f59e0b;
  --card-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", "Work Sans", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #eef5fb, #dfe7ef 45%, #eef5fb);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #eef5fb, #dfe7ef 45%, #eef5fb);
}

.auth-card {
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  padding: 28px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.flash--error { background: #fef2f2; color: #991b1b; }
.flash--info { background: #eff6ff; color: #1d4ed8; }

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

.sidebar {
  background: radial-gradient(circle at 20% 20%, #24354d 0%, #18233a 35%, #0f1724 70%, #0b1220 100%);
  color: #dce2ed;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: 2px 0 24px rgba(0,0,0,0.28);
}

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

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b1221;
  font-size: 18px;
}

.brand__name {
  font-weight: 700;
  color: #f8fafc;
}

.brand__sub {
  font-size: 13px;
  color: #94a3b8;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.18);
  background: #0b1221;
}

.logo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.bird-photos {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bird-photo-thumb {
  max-width: 160px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  cursor: zoom-in;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(226, 232, 240, 0.9);
  background: #0b1120;
  cursor: zoom-out;
}

.photo-lightbox__hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #e5e7eb;
  font-size: 12px;
  opacity: 0.8;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav__item {
  all: unset;
  padding: 12px 14px;
  border-radius: 12px;
  color: #e8ecf5;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.02);
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(2px);
}

.nav__item--active {
  background: linear-gradient(135deg, #1fa2ff 0%, #12d8fa 50%, #a6ffcb 100%);
  color: #0b1221;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

.sidebar__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18);
}

.main {
  padding: 26px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mobile-menu-btn{
  display:none;
  position:fixed;
  top:10px;
  left:14px;
  z-index:1300;
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid #e2e8f0;
  background:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,0.12);
  font-size:20px;
  cursor:pointer;
}

.sidebar-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.35);
  z-index:1100;
}
.sidebar-backdrop.hidden{display:none;}

@media (max-width: 900px) {
  .brand--mobile{
    padding: 12px 12px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .page {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80vw;
    max-width: 320px;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    z-index: 1201;
    padding: 16px 14px;
    gap: 12px;
    align-items: stretch;
    display: block;
  }
  .sidebar.open { transform: translateX(0); }
  .brand { width: 100%; }
  .sidebar__footer { display:none; }
  .nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .nav__item {
    padding: 12px 14px;
    width: 100%;
  }
  .main {
    padding-top: 20px;
  }
  .mobile-menu-btn{display:block;}
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.4px;
}

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

.muted {
  margin: 6px 0 0;
  color: var(--muted);
}

.user-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--card-shadow);
}

.user-card__split {
  width: 1px;
  height: 36px;
  background: var(--line);
}

.label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 18px;
}

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

.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

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

.card--highlight {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid #dbeafe;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pdf-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pdf-frame {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  height: min(78vh, 900px);
}

.pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.ghost {
  all: unset;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
}

.ghost:hover {
  transform: translateY(-1px);
  background: rgba(14, 165, 233, 0.12);
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.stat-card--click { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.stat-card--click:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,0.12); }

.stat-card__title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.stat-card__value {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
}

.pill--success { background: #ecfdf3; color: #047857; }
.pill--warning { background: #fff7ed; color: #9a3412; }
.pill--info { background: #e0f2fe; color: #075985; }
.pill--danger { background: #fee2e2; color: #b91c1c; }
.pill--secondary { background: #f3f4f6; color: #374151; }

.bell-alert{
  position:fixed;
  top:16px;
  right:18px;
  background:#fff7ed;
  color:#b45309;
  border:1px solid #f97316;
  border-radius:999px;
  padding:8px 12px;
  box-shadow:0 8px 20px rgba(0,0,0,0.08);
  text-decoration:none;
  font-size:16px;
  z-index:1000;
  animation:pulse 1.2s infinite;
}
@keyframes pulse{
  0%{transform:scale(1);}
  50%{transform:scale(1.08);}
  100%{transform:scale(1);}
}

.tasks,
.activity,
.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.task__title {
  margin: 0;
  font-weight: 700;
}

.task__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.audio-preview {
  width: 100%;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

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

.pair-badge-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
  flex: 0 0 34px;
}

.timeline__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 12px;
  border: 1px dashed #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

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

.timeline__title {
  margin: 0;
}

.tree-single {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.tree-single__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  border: 1px dashed #dbeafe;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.tree-single__label {
  font-weight: 600;
  color: #0f172a;
  min-width: 90px;
}

.tree-single__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.tree-badge {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  min-width: 130px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.tree-badge strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}

.tree-badge span {
  font-size: 12px;
  color: #475569;
}

.tree-badge--m {
  border-color: #60a5fa;
  background: #eff6ff;
}

.tree-badge--h {
  border-color: #f472b6;
  background: #fdf2f8;
}

.gene-diagram-scroll {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  padding: 12px;
  overflow: auto;
}

.gene-diagram {
  position: relative;
  min-height: 160px;
}

.gene-diagram__lines {
  position: absolute;
  inset: 0;
}

.gene-diagram__lines .gene-link {
  stroke: #cbd5f5;
  stroke-width: 2;
  fill: none;
}

.gene-diagram__nodes {
  position: relative;
}

.gene-node {
  position: absolute;
  min-width: 120px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #fff;
  text-align: center;
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.08);
}

.gene-node strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.gene-node span {
  display: block;
  font-size: 12px;
  color: #475569;
}

.gene-node small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.gene-node--root {
  border-width: 2px;
  box-shadow: 0 6px 12px rgba(234, 179, 8, 0.25);
  background: #fef3c7;
}

.gene-node--m {
  border-color: #60a5fa;
  background: #eff6ff;
}

.gene-node--h {
  border-color: #f9a8d4;
  background: #fdf2f8;
}

.gene-node--u {
  border-color: #cbd5e1;
  background: #fff;
}

.gene-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
  margin-top: 12px;
}

.gene-legend .legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-dot--m { background: #60a5fa; }
.legend-dot--h { background: #f472b6; }
.legend-dot--u { background: #94a3b8; }

.tree-badge--u {
  border-color: #cbd5f5;
  background: #f8fafc;
}

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

.row {
  display: grid;
  grid-template-columns: 90px 1fr 130px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.row__title {
  font-weight: 700;
  margin: 0;
}

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

.row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-8 {
  gap: 8px;
}

.date-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-scroll table {
  min-width: 520px;
}

.activity__item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.activity__title { margin: 0; }
.activity__meta { margin: 0; color: var(--muted); font-size: 13px; }

.alert {
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: linear-gradient(120deg, #fffaf0, #fff7ed);
}

.alert strong { color: #92400e; }

.recipes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.recipe {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.recipe h3 { margin: 0 0 6px; font-size: 15px; }
.recipe p { margin: 0; color: var(--muted); font-size: 13px; }

.recipes--vertical {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.recipe--wide ul {
  padding-left: 16px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
}

.search-bar input {
  flex: 1;
}

.chip {
  all: unset;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s ease;
}

.chip:hover {
  background: #e0f2fe;
}

.chip--secondary {
  background: #f8fafc;
}

.chip--ghost {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

.chip--warning {
  background: #fff7ed;
  border-color: #f97316;
  color: #9a3412;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.gallery-card {
  margin: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.gallery-card__img {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.gallery-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-slider {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  z-index: 1200;
}

.gallery-slider.hidden { display: none; }

.gallery-slider__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e2e8f0;
}

.gallery-slider__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-slider__img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 18px 38px rgba(0,0,0,0.45);
}

.gallery-slider__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gallery-slider__dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0.5;
}
.dot--active {
  width: 12px;
  background: #e2e8f0;
  opacity: 1;
}

.thumb-mini {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  cursor: zoom-in;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 999;
  overscroll-behavior: contain;
}

.modal.hidden { display: none; }

.modal__content {
  width: min(640px, 94vw);
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.25);
}
.modal__content--lg {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
}
#bp_body {
  max-height: 74vh;
  overflow-y: auto;
}
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.modal .close {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #718096;
}

.hidden {
  display: none !important;
}

.skeleton-line {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 50%, #eef1f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  color: #8a9bb5;
  font-size: 12px;
  padding: 10px;
  box-sizing: border-box;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field--full {
  grid-column: 1 / -1;
}

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

.repeat-interval input {
  max-width: 120px;
}

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

input, select, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

textarea { resize: vertical; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost--secondary {
  background: #eef2f6;
  color: #0f172a;
}

.divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 4px 0;
}

@media (max-width: 1024px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; gap: 18px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 18px; }
  .header { flex-direction: column; align-items: flex-start; }
  .modal { align-items: flex-start; padding-top: 40px; }
}

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .activity__item { grid-template-columns: 1fr; }
  .user-card { width: 100%; justify-content: space-between; }
  .card__head { flex-direction: column; align-items: flex-start; }
  .row__actions { justify-content: flex-start; }
  .search-bar { flex-direction: column; }
  .task { flex-direction: column; align-items: flex-start; }
  .task-actions { width: 100%; justify-content: flex-start; }
  .filters-grid { flex-direction: column; }
  .filters-grid .form-field { min-width: 0 !important; width: 100%; }
  .pdf-frame { height: 70vh; }
}
