:root {
  --bg: #f3f3f3;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(68, 68, 68, 0.14);
  --text: #242424;
  --muted: #646464;
  --brand: #d71920;
  --brand-dark: #a90f15;
  --success: #1c6a46;
  --warning: #6f6f6f;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(215, 25, 32, 0.05), transparent 180px),
    linear-gradient(135deg, #ffffff 0%, #f5f5f5 48%, #ededed 100%);
}

body.mobile-menu-open {
  overflow: hidden;
}

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

.app-shell {
  display: grid;
  grid-template-columns: clamp(248px, 22vw, 300px) 1fr;
  min-height: 100vh;
  position: relative;
}

.sidebar-overlay {
  display: none;
}

.sidebar {
  padding: clamp(18px, 1.8vw, 28px);
  background: linear-gradient(180deg, #5f5f5f 0%, #4f4f4f 100%);
  color: #ffffff;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: clamp(14px, 1.4vw, 24px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  z-index: 30;
}

.sidebar-mobile-head {
  display: none;
}

.brand {
  display: block;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: clamp(170px, 15vw, 220px);
  height: auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  opacity: 0.68;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.brand h1,
.topbar h2,
.section-heading h3,
.hero-card h3 {
  margin: 0;
}

.nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-link,
.ghost-button,
.primary-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.nav-link {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  padding: 11px 16px;
}

.nav-link:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.ghost-button:disabled,
.primary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.58;
}

.nav-link.is-active {
  background: linear-gradient(135deg, var(--brand), #ef3d43);
  box-shadow: 0 14px 30px rgba(215, 25, 32, 0.28);
}

.sidebar-card,
.panel,
.hero-card,
.stat-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar-card {
  align-self: end;
  margin-top: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 20px 34px rgba(0, 0, 0, 0.16);
  position: static;
}

.sidebar-title {
  margin: 0 0 6px;
  font-weight: 700;
  text-align: center;
  font-size: clamp(1rem, 1.25vw, 1.2rem);
}

.sidebar-copy,
.muted,
.inline-note {
  color: var(--muted);
}

.inline-note {
  white-space: pre-line;
}

#sidebar-status-content {
  display: grid;
  gap: 12px;
}

.sidebar-status-list {
  display: grid;
  gap: 8px;
}

.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-status-row strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.main-content {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.main-stage {
  flex: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.menu-button,
.sidebar-close-button {
  display: none;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.registration-alert-button {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, #f2212a 0%, #c3131b 100%);
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.24);
  color: #ffffff;
  position: relative;
  cursor: pointer;
}

.registration-alert-button::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.registration-alert-count {
  position: absolute;
  right: -3px;
  top: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #141414;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #ef343a);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.24);
}

.danger-button {
  background: linear-gradient(135deg, #d71920, #b70f15);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(183, 15, 21, 0.22);
}

.ghost-button:disabled {
  background: rgba(245, 245, 245, 0.96);
  color: rgba(36, 36, 36, 0.54);
  border-color: rgba(68, 68, 68, 0.12);
}

.primary-button:disabled,
.danger-button:disabled {
  background: linear-gradient(135deg, #d6d6d6, #bebebe);
  color: rgba(255, 255, 255, 0.92);
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 24px;
}

.is-hidden {
  display: none !important;
}

.registration-partner-only.is-hidden {
  display: none !important;
}

.main-footer {
  margin-top: 24px;
  padding: 18px 0 6px;
  border-top: 1px solid rgba(68, 68, 68, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  color: var(--muted);
}

.footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-link {
  border: 1px solid rgba(68, 68, 68, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.footer-link-primary {
  border-color: rgba(215, 25, 32, 0.26);
  background: linear-gradient(135deg, #f03131, #d71920);
  color: #ffffff;
}

.footer-link-primary:hover {
  box-shadow: 0 12px 22px rgba(215, 25, 32, 0.22);
}

.footer-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    linear-gradient(135deg, rgba(95, 95, 95, 0.12), rgba(215, 25, 32, 0.05));
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(215, 25, 32, 0.06);
  border: 1px solid rgba(215, 25, 32, 0.26);
  color: var(--brand-dark);
  white-space: nowrap;
}

.panel,
.stat-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
}

.panel {
  padding: 24px;
}

.form-panel {
  max-width: 680px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

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

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(68, 68, 68, 0.16);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(215, 25, 32, 0.18);
  border-color: var(--brand);
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  font-weight: 400;
  gap: 12px;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border-radius: 6px;
  border: 1.5px solid rgba(215, 25, 32, 0.26);
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 140ms ease;
  clip-path: polygon(14% 44%, 0 59%, 41% 100%, 100% 17%, 84% 3%, 39% 62%);
  background: #ffffff;
}

input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f2212a 0%, #c3131b 100%);
  box-shadow: 0 10px 18px rgba(215, 25, 32, 0.18);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(215, 25, 32, 0.16);
  outline-offset: 2px;
}

.checkbox-row span {
  line-height: 1.35;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.checkbox-stack {
  display: grid;
  gap: 8px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 22px;
}

.stat-filter-card {
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.stat-filter-card:hover {
  transform: translateY(-1px);
}

.stat-filter-card.is-active {
  border-color: rgba(215, 25, 32, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, rgba(215, 25, 32, 0.06), rgba(255, 255, 255, 0));
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(215, 25, 32, 0.1);
}

.stat-value {
  display: block;
  font-size: 2.3rem;
  font-weight: 700;
}

.stat-value-success {
  color: #43a047;
}

.stat-value-danger {
  color: #b72222;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
}

.profile-grid {
  align-items: start;
}

.admin-grid {
  align-items: start;
}

.list-table {
  display: grid;
}

.list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.is-clickable-row {
  cursor: pointer;
}

.is-clickable-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.admin-list-head,
.admin-list-row {
  grid-template-columns: 1.7fr 1.4fr 1fr 1fr 0.9fr;
}

.partner-projects-head,
.partner-projects-row {
  grid-template-columns: 1.7fr 1fr 1fr 1fr 0.9fr;
}

.partner-dashboard-head,
.partner-dashboard-row {
  grid-template-columns: 1.7fr 1fr 1fr 1fr 0.9fr;
}

.admin-projects-head,
.admin-projects-row {
  grid-template-columns: 1.5fr 1fr 1.3fr 1fr 1fr 0.8fr;
}

.admin-partners-head,
.admin-partners-row {
  grid-template-columns: 1.3fr 1.1fr 1fr 1fr 0.8fr 0.8fr;
}

.admin-registration-head,
.admin-registration-row {
  grid-template-columns: 1.2fr 1fr 1.3fr 0.8fr 0.9fr 0.8fr;
}

.inline-button {
  padding: 8px 14px;
  justify-self: start;
}

.list-head {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(63, 44, 28, 0.08);
}

.status-review {
  background: rgba(138, 90, 16, 0.14);
  color: var(--warning);
}

.status-success {
  background: rgba(40, 103, 77, 0.14);
  color: var(--success);
}

.status-default {
  color: var(--brand-dark);
}

.status-change {
  background: rgba(215, 25, 32, 0.08);
  color: var(--brand-dark);
}

.status-rejected {
  background: rgba(90, 90, 90, 0.12);
  color: #4d4d4d;
}

.topbar .eyebrow,
.section-heading .eyebrow,
.hero-card .eyebrow {
  color: var(--brand);
  opacity: 1;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 4px;
}

.detail-list .is-requested-detail-row {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(215, 25, 32, 0.06);
  outline: 1px solid rgba(215, 25, 32, 0.14);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
}

.validation-list {
  display: grid;
  gap: 14px;
}

.validation-row {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(38, 38, 38, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
}

.validation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.is-requested-field {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(215, 25, 32, 0.06);
  outline: 1px solid rgba(215, 25, 32, 0.14);
}

.is-requested-text {
  color: var(--brand-dark);
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(215, 25, 32, 0.08);
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.14);
}

.checkbox-stack .checkbox-row {
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.checkbox-stack .checkbox-row span {
  font-weight: 600;
  color: var(--text);
}

#approval-pending .form-actions {
  margin-top: 18px;
  margin-bottom: 18px;
}

#profile-pending-note {
  margin-bottom: 18px;
}

#project-pending-note,
#partner-project-feedback-summary {
  margin-bottom: 18px;
}

.project-upload-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.project-dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 24px;
  place-items: center;
  text-align: center;
  border: 2px dashed rgba(215, 25, 32, 0.26);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, rgba(215, 25, 32, 0.05), rgba(68, 68, 68, 0.03));
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.project-dropzone:hover,
.project-dropzone.is-dragover {
  border-color: rgba(215, 25, 32, 0.48);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

.project-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#project-upload-feedback {
  margin: -2px 0 2px;
  white-space: pre-line;
}

.project-upload-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.project-upload-summary span {
  color: var(--muted);
}

.project-upload-list {
  display: grid;
  gap: 10px;
}

.project-upload-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.project-upload-preview {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(215, 25, 32, 0.06);
  border: 1px solid rgba(215, 25, 32, 0.14);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-upload-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.project-upload-name {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.project-upload-size {
  color: var(--muted);
  font-size: 0.95rem;
}

.project-upload-remove {
  min-width: auto;
  padding: 10px 14px;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  min-width: 240px;
}

.admin-partner-filter-row {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  align-items: center;
  gap: 12px;
}

#admin-partner-mode-button {
  justify-self: start;
  white-space: nowrap;
}

#admin-partner-search {
  min-width: 0;
  width: 100%;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.import-dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  place-items: center;
  text-align: center;
  border: 2px dashed rgba(215, 25, 32, 0.26);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, rgba(215, 25, 32, 0.05), rgba(68, 68, 68, 0.03));
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.import-dropzone:hover,
.import-dropzone.is-dragover {
  border-color: rgba(215, 25, 32, 0.48);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

.import-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.import-dropzone-copy {
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}

.import-actions {
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
}

.export-actions-block {
  display: grid;
  gap: 8px;
}

.export-actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.export-switch-note {
  padding-left: 2px;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.switch-slider {
  width: 62px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(68, 68, 68, 0.14);
  position: relative;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.12);
  transition: transform 160ms ease;
}

.switch-field input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--brand), #ef343a);
  border-color: rgba(215, 25, 32, 0.24);
  box-shadow: 0 12px 24px rgba(215, 25, 32, 0.16);
}

.switch-field input:checked + .switch-slider::before {
  transform: translateX(26px);
}

.switch-field input:focus-visible + .switch-slider {
  outline: 2px solid rgba(215, 25, 32, 0.18);
  outline-offset: 2px;
}

.stack-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.stack-list .primary-button,
.stack-list .ghost-button,
.stack-list .danger-button {
  justify-content: center;
}

.info-inline {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(215, 25, 32, 0.05);
  border: 1px solid rgba(215, 25, 32, 0.14);
}

.info-inline span {
  color: var(--muted);
}

.info-card,
.detail-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.info-card p,
.body-copy,
.timeline-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.detail-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  align-items: start;
}

.detail-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.detail-card h4 {
  margin: 0 0 14px;
}

.detail-card + .detail-card {
  margin-top: 16px;
}

.compact-heading {
  margin-bottom: 12px;
}

.document-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.document-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(215, 25, 32, 0.06);
  border: 1px solid rgba(215, 25, 32, 0.14);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.document-name {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.document-open {
  grid-column: 1 / 3;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.document-open:hover .document-name {
  color: var(--brand);
}

.document-warning {
  grid-column: 2 / 4;
  margin-top: 4px;
  color: var(--brand);
  font-weight: 600;
}

.document-download {
  white-space: nowrap;
}

.file-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 0;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(14px);
}

.export-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.export-progress-card {
  width: min(560px, 100%);
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 16px;
}

.export-progress-card h3 {
  margin: 0;
}

.export-progress-bar-shell {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(68, 68, 68, 0.08);
  overflow: hidden;
  border: 1px solid rgba(68, 68, 68, 0.1);
}

.export-progress-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--brand), #ef343a);
  box-shadow: 0 10px 20px rgba(215, 25, 32, 0.2);
  transition: width 220ms ease;
}

.export-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.file-preview-shell {
  position: relative;
  height: 100%;
  padding: 0;
}

.file-preview-topbar {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
}

.file-preview-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.file-preview-body iframe,
.file-preview-body img {
  border: 0;
  display: block;
}

.file-preview-body iframe {
  width: calc(100vw - 40px);
  height: calc(100vh - 40px);
}

.file-preview-body img {
  width: auto;
  height: auto;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  object-fit: contain;
}

.file-preview-text {
  margin: 0;
  width: min(1100px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 24px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  color: #fff;
  background: rgba(10, 10, 10, 0.52);
  border-radius: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.change-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.change-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.change-label {
  font-weight: 700;
}

.change-values {
  display: grid;
  gap: 6px;
}

.change-old,
.change-new {
  color: var(--muted);
}

.status-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.change-old strong,
.change-new strong {
  color: var(--text);
}

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

.timeline-item {
  padding-left: 14px;
  border-left: 3px solid rgba(215, 25, 32, 0.18);
}

.empty-state {
  padding: 18px 0;
  color: var(--muted);
}

.empty-state.compact {
  padding: 0;
}

.achievement-panel {
  overflow: hidden;
}

.medal-card {
  min-height: 100%;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 8px 8px;
  text-align: center;
}

.sidebar-card .medal-card {
  padding: 4px 0 0;
  gap: 6px;
}

.sidebar-card .achievement-label,
.sidebar-card .achievement-tier-text {
  color: rgba(255, 255, 255, 0.78);
}

.sidebar-card .achievement-value {
  color: #ffffff;
}

.sidebar-card .medal-orbit {
  width: clamp(118px, 11vw, 146px);
  height: clamp(146px, 14vw, 184px);
}

.sidebar-card .medal-ribbon {
  width: clamp(58px, 5.4vw, 72px);
  height: clamp(62px, 5.8vw, 76px);
}

.sidebar-card .medal-disc {
  top: clamp(44px, 4.2vw, 54px);
  width: clamp(84px, 8vw, 106px);
  height: clamp(84px, 8vw, 106px);
}

.sidebar-card .medal-core {
  width: clamp(48px, 4.7vw, 58px);
  height: clamp(48px, 4.7vw, 58px);
  font-size: clamp(0.82rem, 0.92vw, 0.98rem);
}

.sidebar-card .achievement-value {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.sidebar-card .achievement-value.is-compact {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.sidebar-card .achievement-value.is-tight {
  font-size: clamp(1.15rem, 2vw, 1.65rem);
}

.medal-orbit {
  position: relative;
  width: 180px;
  height: 220px;
  display: grid;
  justify-items: center;
  align-items: start;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.18));
}

.medal-ribbon {
  width: 88px;
  height: 92px;
  clip-path: polygon(6% 0, 94% 0, 78% 74%, 50% 100%, 22% 74%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.16)),
    linear-gradient(180deg, #f2212a 0%, #c4131b 45%, #a70f15 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 22px rgba(215, 25, 32, 0.22);
}

.medal-disc {
  position: absolute;
  top: 64px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 7px solid rgba(255, 244, 236, 0.68);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 20px rgba(0, 0, 0, 0.22),
    0 16px 26px rgba(0, 0, 0, 0.18);
  animation: medal-float 6s ease-in-out infinite;
  transform-style: preserve-3d;
  transform-origin: center center;
  backface-visibility: hidden;
}

.medal-disc::before,
.medal-disc::after,
.medal-disc .medal-core::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  backface-visibility: hidden;
}

.medal-disc::before {
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.2),
    inset 0 -8px 14px rgba(0, 0, 0, 0.18);
}

.medal-disc::after {
  inset: 0;
  transform: translateZ(-1px);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(58, 35, 18, 0.55), rgba(255, 255, 255, 0.06) 22%, rgba(0, 0, 0, 0.28) 78%, rgba(30, 18, 10, 0.65));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  filter: saturate(0.9);
}

.medal-core {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-size: 1rem;
  font-weight: 900;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(38, 24, 12, 0.82), rgba(18, 10, 4, 0.88));
  color: #fffdf8;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 2px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -10px 14px rgba(0, 0, 0, 0.28);
  position: relative;
  transform: translateZ(14px);
  backface-visibility: hidden;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.medal-core-wide {
  font-size: 1rem;
}

.medal-core-tight {
  font-size: 0.84rem;
}

.medal-card[data-tier="bronze"] .medal-core {
  color: #fff7f0;
}

.medal-card[data-tier="silver"] .medal-core {
  color: #ffffff;
}

.medal-card[data-tier="gold"] .medal-core {
  color: #fff6cf;
}

.medal-card[data-tier="platin"] .medal-core {
  color: #f4fcff;
}

.medal-core::before {
  inset: -7px;
  transform: translateZ(-8px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.24)),
    rgba(67, 43, 25, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 6px rgba(0, 0, 0, 0.24);
}

.medal-card[data-tier="none"] .medal-disc {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.54), transparent 24%),
    linear-gradient(145deg, #cccccc 0%, #9f9f9f 38%, #767676 100%);
}

.medal-card[data-tier="bronze"] .medal-disc {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 235, 216, 0.48), transparent 24%),
    linear-gradient(145deg, #d7a07a 0%, #b67648 38%, #7f4b2f 100%);
}

.medal-card[data-tier="silver"] .medal-disc {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(145deg, #eef3f8 0%, #c4ced8 38%, #8d98a3 100%);
}

.medal-card[data-tier="gold"] .medal-disc {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 251, 195, 0.74), transparent 24%),
    linear-gradient(145deg, #ffe789 0%, #e0b437 38%, #b9780f 100%);
}

.medal-card[data-tier="platin"] .medal-disc {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.82), transparent 24%),
    linear-gradient(145deg, #f5fbff 0%, #c9dbe6 38%, #89a7b8 100%);
}

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

.achievement-value {
  margin: 0;
  font-weight: 800;
  line-height: 1;
  font-size: clamp(2rem, 6vw, 3.9rem);
  letter-spacing: -0.04em;
}

.achievement-value.is-compact {
  font-size: clamp(1.6rem, 4.2vw, 2.8rem);
}

.achievement-value.is-tight {
  font-size: clamp(1.25rem, 3.2vw, 2.2rem);
}

.achievement-tier-text {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

@keyframes medal-spin {
  from {
    transform: none;
  }
  to {
    transform: none;
  }
}

@keyframes medal-float {
  0% {
    transform: perspective(900px) rotateY(-3deg) rotateX(2deg) rotateZ(-1deg) translateY(0) scale(1);
  }
  25% {
    transform: perspective(900px) rotateY(0deg) rotateX(0deg) rotateZ(0deg) translateY(-2px) scale(1.015);
  }
  50% {
    transform: perspective(900px) rotateY(3deg) rotateX(-2deg) rotateZ(1deg) translateY(0) scale(1);
  }
  75% {
    transform: perspective(900px) rotateY(1deg) rotateX(1deg) rotateZ(0deg) translateY(2px) scale(0.995);
  }
  100% {
    transform: perspective(900px) rotateY(-3deg) rotateX(2deg) rotateZ(-1deg) translateY(0) scale(1);
  }
}

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 24, 24, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 20;
    display: block;
  }

  .sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    width: min(84vw, 340px);
    max-width: 340px;
    padding: 18px;
    gap: 18px;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100svh;
    grid-template-rows: auto auto auto 1fr;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.22);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-mobile-title {
    font-weight: 700;
    font-size: 1rem;
  }

  .sidebar-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
  }

  .menu-button {
    display: inline-grid;
    gap: 4px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid rgba(68, 68, 68, 0.14);
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  }

  .menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }

  .topbar {
    align-items: flex-start;
  }

  .sidebar-card {
    margin-top: 0;
    position: static;
  }

  .topbar,
  .section-heading,
  .hero-card,
  .main-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .stats-grid,
  .content-grid,
  .import-layout,
  .two-columns,
  .detail-card-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (min-width: 981px) and (max-width: 1320px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
