/* ============================================================
   UI v2 — portal shell, navigation, dashboard & shared widgets
   Loaded after app.css
   ============================================================ */

:root {
  --sg-green-900: #0a3d2e;
  --sg-green-800: #0b4a36;
  --sg-green-700: #0f6042;
  --sg-green-600: #128456;
  --sg-green-500: #16a34a;
  --sg-ink: #16281f;
  --sg-muted: #61746c;
  --sg-line: #e2ebe6;
  --sg-surface: #ffffff;
  --sg-canvas: #eef4f1;
  --sg-radius: 12px;
  --sg-radius-sm: 10px;
  --sg-shadow: 0 12px 34px rgba(16, 45, 35, 0.08);
}

body {
  background: var(--sg-canvas);
}

.icon {
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- Shell ---------- */

.portal {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(22, 163, 74, 0.09), transparent 60%),
    var(--sg-canvas);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 266px;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #0b3f31 0%, #082e24 100%);
  box-shadow: 8px 0 32px rgba(8, 40, 30, 0.18);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 16px;
  margin: 0 0 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.sidebar-brand-text strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.2px;
}

.sidebar-brand-text span {
  color: #a9cdbf;
  font-size: 12px;
}

.sidebar-collapse {
  margin-left: auto;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #d6eee6;
  transition: 160ms ease;
}

.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-collapse svg {
  transition: transform 200ms ease;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.sidebar nav a,
.sidebar-nav a {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbe4da;
  background: transparent;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}

.sidebar nav a:hover,
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar nav a.active,
.sidebar-nav a.active {
  color: #08301f;
  background: linear-gradient(135deg, #d9f7e7, #ffffff);
  box-shadow: 0 8px 20px rgba(6, 35, 25, 0.25);
}

.sidebar-nav a.active .nav-icon {
  color: var(--sg-green-700);
}

.nav-icon {
  width: 22px;
  display: grid;
  place-items: center;
  color: #9fcdba;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-text {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.sidebar-user-text strong {
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-text span {
  color: #a9cdbf;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  color: var(--sg-green-700);
  background: #e8f7ef;
}

.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar .logout-button {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  color: #ffd9d9;
  background: rgba(185, 28, 28, 0.24);
  border: 1px solid rgba(255, 120, 120, 0.28);
  border-radius: 10px;
  font-weight: 700;
}

.sidebar .logout-button:hover {
  background: #b91c1c;
  color: #fff;
}

.sidebar .account-button {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  color: #d6ece2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.sidebar .account-button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.content {
  margin-left: 266px;
  padding: 22px 26px 30px;
  transition: margin-left 180ms ease;
}

.portal.sidebar-compact .sidebar {
  width: 90px;
  padding-inline: 12px;
}

.portal.sidebar-compact .content {
  margin-left: 90px;
}

.portal.sidebar-compact .sidebar-brand {
  justify-content: center;
}

.portal.sidebar-compact .sidebar-brand-link {
  justify-content: center;
}

.portal.sidebar-compact .sidebar-brand-text,
.portal.sidebar-compact .nav-label,
.portal.sidebar-compact .sidebar-user-text {
  display: none;
}

.portal.sidebar-compact .sidebar-collapse {
  display: none;
}

.portal.sidebar-compact .sidebar-nav a,
.portal.sidebar-compact .logout-button,
.portal.sidebar-compact .account-button {
  justify-content: center;
  padding-inline: 0;
}

.portal.sidebar-compact .sidebar-user {
  justify-content: center;
  padding: 6px;
}

.portal.sidebar-compact .sidebar-footer {
  justify-items: center;
}

.sidebar-backdrop {
  display: none;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 12px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid rgba(224, 234, 229, 0.9);
  border-radius: var(--sg-radius);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(16, 45, 35, 0.06);
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  color: var(--sg-ink);
}

.topbar p {
  margin: 3px 0 0;
  color: var(--sg-muted);
  font-size: 13.5px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #0b5f3e;
  background: #e8f7ef;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--sg-line);
  border-radius: 999px;
  background: #fff;
}

.user-chip-text {
  display: grid;
  line-height: 1.3;
}

.user-chip-text strong {
  font-size: 13px;
  color: var(--sg-ink);
}

.user-chip-text span {
  font-size: 11.5px;
  color: var(--sg-muted);
}

.icon-button {
  color: #1c332b;
  transition: 150ms ease;
}

.icon-button:hover {
  border-color: var(--sg-green-600);
  color: var(--sg-green-700);
  background: #f3fbf7;
}

.mobile-menu {
  display: none;
}

/* ---------- Alerts ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.alert svg {
  margin-top: 2px;
}

.alert span {
  flex: 1;
}

.alert-success {
  color: #0b5f3e;
  background: #e8f7ef;
  border: 1px solid #bfe7d2;
}

.alert-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.alert-close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  padding: 2px;
  display: grid;
  place-items: center;
}

.alert-close:hover {
  opacity: 1;
}

/* ---------- Cards & panels ---------- */

.panel,
.stat-card,
.committee-card {
  border-color: var(--sg-line);
  border-radius: var(--sg-radius);
  box-shadow: var(--sg-shadow);
}

.panel {
  overflow-x: auto;
}

.section-title h3 {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title span {
  white-space: nowrap;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  font-size: 23px;
}

.color-stat-card {
  border-radius: var(--sg-radius);
  min-height: 116px;
  align-items: center;
}

.color-stat-card > div {
  min-width: 0;
}

.color-stat-card strong {
  font-size: 22px;
  line-height: 1.3;
}

.color-stat-card svg {
  opacity: 0.85;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.ok {
  color: #0b5f3e;
  background: #e8f7ef;
}

.pill.warn {
  color: #92400e;
  background: #fef3c7;
}

.pill.bad {
  color: #991b1b;
  background: #fee2e2;
}

.pill.muted {
  color: #475569;
  background: #f1f5f9;
}

.pill.info {
  color: #1d4ed8;
  background: #dbeafe;
}

/* Tables */
.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: #f7fbf9;
}

.data-table th {
  font-size: 12.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.data-table td {
  font-size: 14px;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  white-space: nowrap;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-cell-lines {
  display: grid;
  line-height: 1.35;
  min-width: 0;
}

.member-cell-lines span {
  color: var(--sg-muted);
  font-size: 12px;
}

.form-existing-media {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-sm);
  background: #f7fbf9;
}

.form-existing-media .secondary-button {
  margin-left: auto;
}

/* Info grids in panels */
.info-grid .wide {
  grid-column: span 3;
}

@media (max-width: 980px) {
  .info-grid .wide {
    grid-column: 1 / -1;
  }
}

/* Empty states */
.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 30px 18px;
  text-align: center;
  color: var(--sg-muted);
}

.empty-state svg {
  color: #9ec8b5;
}

/* Progress */
.progress-track {
  height: 10px;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--sg-muted);
  font-size: 12.5px;
  font-weight: 700;
}

/* Gateway selector */
.gateway-card {
  position: relative;
  cursor: pointer;
  transition: 150ms ease;
  padding: 10px;
}

.gateway-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gateway-card span {
  font-size: 12.5px;
}

.gateway-card:has(input:checked) {
  border-color: var(--sg-green-600);
  background: #e8f7ef;
  box-shadow: 0 0 0 3px rgba(15, 122, 79, 0.12);
}

/* Reports */
.report-toolbar-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.report-toolbar-form h3 {
  margin: 0 0 4px;
}

.report-toolbar-form p {
  margin: 0;
}

.report-toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.report-toolbar-actions label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-muted);
}

.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--sg-line);
}

.period-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--sg-line);
  background: #fff;
  color: var(--sg-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 140ms ease;
}

.period-tab:hover {
  border-color: var(--sg-green-500);
  color: var(--sg-green-700);
}

.period-tab.active {
  background: var(--sg-green-600);
  border-color: var(--sg-green-600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 122, 79, 0.22);
}

.data-table tfoot th {
  background: #f6faf8;
  border-top: 1px solid var(--sg-line);
  font-size: 13px;
}

.doc-link {
  display: block;
  color: var(--sg-green-700);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.doc-link:hover {
  text-decoration: underline;
}

/* Notices */
.notice-stack {
  display: grid;
  gap: 12px;
}

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-sm);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.notice-card:hover {
  border-color: #b7ddc9;
  box-shadow: 0 8px 20px rgba(15, 63, 44, 0.06);
}

.notice-date {
  flex: none;
  display: grid;
  place-items: center;
  width: 62px;
  padding: 8px 4px;
  border-radius: var(--sg-radius-sm);
  background: #e8f7ef;
  color: var(--sg-green-700);
  line-height: 1.15;
}

.notice-date strong {
  font-size: 22px;
}

.notice-date span {
  font-size: 11.5px;
  font-weight: 600;
}

.notice-body {
  flex: 1;
  min-width: 0;
}

.notice-body h4 {
  margin: 0 0 4px;
  font-size: 15.5px;
}

.notice-body p {
  margin: 0;
  color: var(--sg-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.notice-card .action-row {
  flex: none;
}

.resolution-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.resolution-viewer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.resolution-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.resolution-viewer-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f7a4f;
  font-size: 13px;
  font-weight: 800;
}

.resolution-frame {
  width: 100%;
  height: 520px;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .resolution-frame {
    height: 400px;
  }
}

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

.resolution-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  background: #fff;
}

.resolution-item.is-active {
  border-color: var(--sg-green-500);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.resolution-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.resolution-meta strong {
  font-size: 15px;
  color: var(--sg-ink);
}

.resolution-meta span {
  font-size: 12px;
}

/* Meetings */
.meeting-stack {
  display: grid;
  gap: 12px;
}

.meeting-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-sm);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.meeting-card:hover {
  border-color: #b7ddc9;
  box-shadow: 0 8px 20px rgba(15, 63, 44, 0.06);
}

.meeting-card.highlight {
  border-color: #b7ddc9;
  background: linear-gradient(180deg, #f4fbf7 0%, #fff 70%);
}

.meeting-date {
  flex: none;
  display: grid;
  place-items: center;
  width: 62px;
  padding: 8px 4px;
  border-radius: var(--sg-radius-sm);
  background: #e8f7ef;
  color: var(--sg-green-700);
  line-height: 1.15;
}

.meeting-date strong {
  font-size: 22px;
}

.meeting-date span {
  font-size: 11.5px;
  font-weight: 600;
}

.meeting-body {
  flex: 1;
  min-width: 0;
}

.meeting-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.meeting-head h4 {
  margin: 0;
  font-size: 15.5px;
}

.meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 6px;
  color: var(--sg-muted);
  font-size: 12.5px;
}

.meeting-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meeting-body p {
  margin: 0 0 4px;
  color: var(--sg-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.meeting-body p strong {
  color: var(--sg-ink);
}

.meeting-card .action-row {
  flex: none;
}

@media (max-width: 720px) {
  .meeting-card {
    flex-wrap: wrap;
  }

  .meeting-card .action-row {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Advice */
.advice-stack {
  display: grid;
  gap: 12px;
}

.advice-card {
  padding: 16px;
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-sm);
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
}

.advice-head {
  margin-bottom: 10px;
}

.advice-card h4 {
  margin: 0 0 6px;
  font-size: 15.5px;
}

.advice-card > .pill {
  margin-bottom: 8px;
}

.advice-card p {
  margin: 0;
  color: var(--sg-muted);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
}

/* Update requests */
.update-steps {
  display: grid;
  gap: 12px;
}

.update-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.update-step > span {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8f7ef;
  color: var(--sg-green-700);
  font-weight: 700;
  font-size: 13px;
}

.update-step strong {
  display: block;
  font-size: 14px;
}

.update-step small {
  color: var(--sg-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.update-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--sg-line);
}

.update-request-row:last-of-type {
  border-bottom: none;
}

.update-request-row strong {
  display: block;
  font-size: 13.5px;
}

/* Receipt */
.receipt-page {
  min-height: 100vh;
  padding: 30px 18px;
  background: var(--sg-canvas);
}

.receipt-shell {
  width: min(720px, 100%);
  margin: 0 auto;
}

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

.receipt-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.receipt-brand strong {
  display: block;
  font-size: 19px;
  color: var(--sg-green-800);
}

.receipt-brand span {
  display: block;
  font-size: 12.5px;
}

.receipt-stamp small {
  color: inherit;
  font-size: 11.5px;
  opacity: 0.85;
}

.receipt-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.receipt-meta .info-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7fbf9;
  border: 1px solid #e6efea;
}

.receipt-amount {
  border-radius: 12px;
}

.receipt-amount-side {
  text-align: right;
}

.receipt-amount-side strong {
  font-size: 15px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.receipt-paper .digital-receipt-notice {
  margin-top: 18px;
}

@media (max-width: 640px) {
  .receipt-meta {
    grid-template-columns: 1fr;
  }

  .receipt-header {
    flex-direction: column;
  }

  .receipt-amount {
    flex-direction: column;
    align-items: flex-start;
  }

  .receipt-amount-side {
    text-align: left;
  }
}

/* Backups */
.backup-create-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.backup-create-row p {
  margin: 0;
  max-width: 62ch;
}

.backup-create-row .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.backup-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--sg-muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.backup-steps code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f7f4;
  color: var(--sg-green-800);
  font-size: 12.5px;
}

.backup-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  line-height: 1.6;
}

.backup-warning code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #fef3c7;
  font-size: 12.5px;
}

.backup-import-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.backup-import-form input[type="file"] {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fbfa;
  font-family: inherit;
  font-size: 13px;
}

.backup-import-form .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.backup-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.backup-import-actions form {
  margin: 0;
}


/* Projects */
.project-card {
  padding: 20px;
}

.project-card .info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-card .info-item {
  padding: 10px 12px;
}

.project-documents {
  margin-top: 4px;
}

.project-document {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.project-document .document-actions {
  display: flex;
  gap: 6px;
}

.project-hero-figure {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Profile */
.profile-head-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: var(--sg-radius);
  border: 1px solid var(--sg-line);
  background: linear-gradient(180deg, #ffffff, #f4fbf7);
  box-shadow: var(--sg-shadow);
}

.profile-head-card .avatar {
  width: 86px;
  height: 86px;
  flex: 0 0 86px;
  border-radius: 14px;
  font-size: 28px;
  font-weight: 800;
}

.profile-head-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-head-main h2 {
  margin: 0;
  font-size: 24px;
  color: var(--sg-ink);
}

.profile-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--sg-muted);
  font-size: 13px;
}

.profile-head-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Footer */
.portal-footer {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--sg-line);
  color: #7a8d85;
  font-size: 12.5px;
  text-align: center;
}

/* ---------- Responsive shell ---------- */

@media (max-width: 1180px) {
  .sidebar {
    width: 248px;
  }

  .content {
    margin-left: 248px;
  }
}

@media (max-width: 980px) {
  .sidebar,
  .portal.sidebar-compact .sidebar {
    width: 274px;
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

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

  .content,
  .portal.sidebar-compact .content {
    margin-left: 0;
    padding: 16px;
  }

  .portal.sidebar-compact .sidebar-brand-text,
  .portal.sidebar-compact .nav-label,
  .portal.sidebar-compact .sidebar-user-text {
    display: block;
  }

  .portal.sidebar-compact .sidebar-brand {
    justify-content: flex-start;
  }

  .portal.sidebar-compact .sidebar-nav a,
  .portal.sidebar-compact .logout-button {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .portal.sidebar-compact .sidebar-user {
    justify-content: flex-start;
  }

  .portal.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(6, 26, 19, 0.48);
    backdrop-filter: blur(2px);
  }

  .sidebar-collapse {
    display: none;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    top: 8px;
    padding: 12px 14px;
  }

  .date-chip {
    display: none;
  }

  .topbar h2 {
    font-size: 19px;
  }

  .portal-footer {
    margin-bottom: 8px;
  }
}

@media (max-width: 640px) {
  .user-chip-text {
    display: none;
  }

  .user-chip {
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .topbar {
    gap: 10px;
  }

  .stat-grid,
  .member-stat-grid {
    grid-template-columns: 1fr;
  }

  table,
  .data-table {
    min-width: 620px;
  }

  .form-grid > label {
    grid-column: 1 / -1;
  }

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

  .profile-head-card {
    align-items: flex-start;
  }
}

/* ---------- Login v2 ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background:
    radial-gradient(900px 500px at 12% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
    linear-gradient(160deg, #07291f 0%, #0b3f31 48%, #0a5a3d 100%);
}

.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 5vw, 64px);
  color: #ecfdf5;
  overflow: hidden;
}

.login-showcase::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 62%);
  pointer-events: none;
}

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

.login-showcase .showcase-brand img {
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}

.login-showcase h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.login-showcase p {
  margin: 12px 0 0;
  max-width: 46ch;
  color: #b9d8cd;
  line-height: 1.8;
  font-size: 15px;
}

.showcase-points {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.showcase-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.showcase-point svg {
  color: #6ee7b7;
  margin-top: 2px;
}

.showcase-point strong {
  display: block;
  font-size: 14px;
}

.showcase-point span {
  color: #a9cdbf;
  font-size: 12.5px;
  line-height: 1.6;
}

.showcase-foot {
  color: #8fb8a9;
  font-size: 12.5px;
}

.login-card-side {
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 42px);
  background: #f4f8f6;
}

.login-stack {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
}

.login-notice {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
}

.login-notice strong {
  font-size: 14px;
}

.login-notice p {
  margin: 0;
  color: #854d0e;
  line-height: 1.7;
}

.login-panel {
  box-sizing: border-box;
  width: 100%;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--sg-line);
  background: #fff;
  box-shadow: 0 24px 60px rgba(7, 42, 31, 0.16);
}

.login-panel .login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.login-panel .login-brand .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
  color: #123f31;
}

.login-panel .login-sub {
  margin: 4px 0 22px;
  color: var(--sg-muted);
  font-size: 13.5px;
}

.login-panel h2 {
  margin: 0 0 6px;
}

.login-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--sg-line);
  color: #6a7d75;
  font-size: 12.5px;
}

.login-help .pill {
  font-size: 11.5px;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6a7d75;
}

.password-toggle:hover {
  background: #f1f7f4;
  color: var(--sg-green-700);
}

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

  .login-showcase {
    padding: 28px 22px;
  }

  .showcase-points {
    margin-top: 18px;
  }

  .login-card-side {
    padding: 18px;
  }
}

/* ---------- Register ---------- */

.login-shell.register-shell {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.register-shell .login-showcase {
  position: sticky;
  top: 0;
  min-height: 100vh;
}

.login-card-side.register-side {
  align-items: start;
  padding-block: 34px;
}

.register-panel {
  width: min(760px, 100%);
}

.register-panel .form-grid {
  margin-top: 6px;
}

.register-panel input[type="file"] {
  padding: 9px 12px;
  background: #f8fbfa;
}

.register-panel .full-button {
  margin-top: 16px;
}

@media (max-width: 960px) {
  .login-shell.register-shell {
    grid-template-columns: 1fr;
  }

  .register-shell .login-showcase {
    position: relative;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .login-showcase h1 {
    font-size: 28px;
  }

  .login-panel {
    padding: 22px;
  }
}

/* Project details */
.project-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-radius: var(--sg-radius);
  border: 1px solid var(--sg-line);
  background: linear-gradient(135deg, #ecfdf5, #f0f9ff);
  box-shadow: var(--sg-shadow);
}

.project-detail-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.project-detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #0f7a4f;
  background: #dcfce7;
  font-size: 13px;
  font-weight: 800;
}

.project-detail-hero h2 {
  margin: 0;
  font-size: 30px;
  color: #0b3b2a;
  word-break: break-word;
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #475569;
  font-size: 14px;
}

.project-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.project-detail-budget {
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--sg-line);
  background: #ffffff;
  text-align: right;
}

.project-detail-budget span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.project-detail-budget strong {
  color: #0f7a4f;
  font-size: 24px;
}

.project-detail-budget small {
  color: #64748b;
  font-size: 12px;
}

.fund-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.fund-progress-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.fund-progress-head strong {
  color: #0f7a4f;
  font-size: 28px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e8f1ec;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f7a4f, #34d399);
  transition: width 0.3s ease;
}

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

.project-facts > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2ece7;
  background: #f8fbfa;
}

.project-facts span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.project-facts strong {
  color: #0b3b2a;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-list {
  display: grid;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: #64748b;
}

.detail-row strong {
  color: #0b3b2a;
  text-align: right;
}

.project-card-footer {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .project-detail-grid,
  .project-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .project-detail-hero {
    padding: 20px;
  }

  .project-detail-hero h2 {
    font-size: 23px;
  }

  .project-detail-budget {
    width: 100%;
    text-align: left;
  }
}
