@import url("report-content.css");

:root {
  --ink: #14241c;
  --pine: #16382c;
  --moss: #1f6a50;
  --leaf: #2f8f6b;
  --gold: #c4a35a;
  --sand: #f3efe4;
  --paper: #fffcf7;
  --line: #d9d1c0;
  --muted: #5f6e66;
  --danger: #9b2c2c;
  --ok: #1b7a4a;
  --shadow: 0 18px 40px rgba(20, 36, 28, .08);
  --radius: 18px;
  --sidebar: 268px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
}

a { color: var(--moss); text-decoration: none; }
a:hover { color: var(--pine); }

h1, h2, .brand-type { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: 1.85rem; margin: 0 0 .35rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
p { line-height: 1.55; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 0; cursor: pointer; font-family: inherit; font-weight: 600;
  border-radius: 999px; padding: .72rem 1.15rem; font-size: .95rem;
  transition: .15s transform, .15s background, .15s box-shadow;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--moss); color: #fff; }
.btn-primary:hover { background: var(--pine); color: #fff; }
.btn-gold { background: var(--gold); color: #1b160c; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #f8e8e8; color: var(--danger); }
.btn-sm { padding: .42rem .8rem; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.input, select, textarea {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem .9rem; outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(47,143,107,.15); }
label { display: block; font-size: .82rem; font-weight: 600; margin: 0 0 .35rem; color: var(--pine); }
.field { margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.flash { border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1rem; font-weight: 500; }
.flash-error { background: #fdecec; color: var(--danger); }
.flash-ok { background: #e8f6ee; color: var(--ok); }
.flash-warn { background: #fff6e5; color: #8a5a12; }

.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: radial-gradient(1200px 600px at -10% -10%, #2f8f6b33, transparent),
              linear-gradient(160deg, #10251c, #1b4334 55%, #16382c);
}
.auth-story { color: #f6f1e6; padding: 4.5rem 4rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-story h1 { font-size: 3rem; color: #fff; max-width: 11ch; }
.auth-story p { color: #d7e7de; max-width: 42ch; font-size: 1.05rem; }
.auth-mark { display: flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.auth-card-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.card {
  background: var(--paper); border: 1px solid #efe8d8; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem;
}
.auth-card { width: min(420px, 100%); padding: 2rem; }
.muted { color: var(--muted); font-size: .92rem; }
.tiny { font-size: .78rem; color: var(--muted); }

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--pine); color: #e8f3ed; padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 1.4rem;
}
.logo { display: flex; align-items: center; gap: .7rem; color: #fff; padding: .3rem .5rem; }
.logo svg { width: 36px; height: 36px; }
.logo strong { font-family: var(--serif); font-size: 1.35rem; }
.nav a {
  display: flex; align-items: center; gap: .7rem; color: #d5e7dd; padding: .72rem .85rem;
  border-radius: 12px; font-weight: 550;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-foot { margin-top: auto; padding: .85rem; background: rgba(0,0,0,.16); border-radius: 14px; }
.sidebar-foot span { display: block; color: #9db8ab; font-size: .75rem; }

.main { padding: 1.5rem 1.8rem 3rem; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat { padding: 1.2rem 1.3rem; }
.stat b { display: block; font-family: var(--serif); font-size: 2rem; }
.stat span { color: var(--muted); font-size: .85rem; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.badge {
  display: inline-flex; border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; font-weight: 700;
  background: #e7f3ec; color: var(--moss);
}
.badge.gold { background: #f6edd6; color: #7a5b16; }
.badge.gray { background: #ececec; color: #555; }

.drop {
  border: 1.5px dashed #c9b896; border-radius: 18px; padding: 2rem; text-align: center; background: #fffdf8;
}
.drop.drag { background: #eef7f2; border-color: var(--leaf); }
.steps { display: grid; gap: .7rem; margin-top: 1.2rem; }
.step { display: flex; gap: .8rem; align-items: center; padding: .75rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.step.on { border-color: var(--leaf); }
.step.done { background: #e9f6ef; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #ccc; }
.step.on .dot { background: var(--gold); box-shadow: 0 0 0 4px #f3e6c4; }
.step.done .dot { background: var(--ok); }

.exam-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 1rem;
  align-items: start;
}
.exam-main-form { display: contents; }
.exam-data-card { grid-column: 1; grid-row: 1; }
.exam-images-card { grid-column: 2; grid-row: 1 / -1; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.exam-span-full { grid-column: 1; }
.exam-images-card .gallery { grid-template-columns: 1fr; }
.exam-images-card .gallery figure { background: var(--paper); border: 1px solid var(--line); }
.exam-images-card .gallery img { height: 140px; object-fit: cover; border-radius: 12px 12px 0 0; }
.exam-images-card .gallery figcaption {
  position: static; color: var(--ink); background: transparent; padding: .5rem .55rem .65rem;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.gallery a, .gallery figure {
  margin: 0; background: #111; border-radius: 12px; overflow: hidden; display: block; position: relative;
}
.gallery img { width: 100%; height: 150px; object-fit: cover; display: block; }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .4rem .55rem;
  color: #fff; font-size: .72rem; background: linear-gradient(transparent, #000c);
}

.report {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem 1.8rem;
}
.report-editor-wrap .tox-tinymce {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: none;
}
.report-editor-wrap .tox .tox-edit-area__iframe {
  background: #fff;
}

.pager-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

@media (max-width: 980px) {
  .exam-review-grid { grid-template-columns: 1fr; }
  .exam-data-card, .exam-images-card { grid-column: 1; grid-row: auto; }
  .exam-images-card { position: static; max-height: none; }
  .exam-images-card .gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .auth-shell, .app, .grid-2, .grid-3, .stat-grid { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .sidebar { display: none; }
  .main { padding: 1rem; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav {
  display: none; gap: .4rem; overflow: auto; padding: .6rem 1rem; background: var(--pine);
}
.mobile-nav a { color: #fff; white-space: nowrap; padding: .45rem .7rem; border-radius: 999px; font-size: .85rem; }
