
* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fa;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 42px auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4263a5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -.04em;
}

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

.subhead,
.muted {
  color: #65718a;
}

.subhead {
  margin: 8px 0 0;
}

.status {
  padding: 8px 13px;
  border-radius: 999px;
  background: #e6ebf3;
  color: #46536b;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.projects-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 84px;
  height: 84px;
  border-radius: 18px;
  background: #edf3ff;
  box-shadow: 0 6px 16px rgba(36, 93, 204, .14);
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}

.projects-shortcut-icon {
  font-size: 34px;
  line-height: 1;
}

.projects-shortcut-label {
  font-size: 12px;
  font-weight: 800;
  color: #245dcc;
}

.projects-shortcut:hover {
  background: #dbe8ff;
}

.projects-shortcut:active {
  transform: translateY(1px);
}

.status.ok {
  background: #e3f7ec;
  color: #17643a;
}

.status.error {
  background: #fde8e8;
  color: #9c2424;
}

.panel {
  background: #fff;
  border: 1px solid #e1e7f0;
  border-radius: 18px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(26, 43, 74, .045);
}

.login-panel {
  max-width: 550px;
}

.login-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 14px;
  background: #edf3ff;
  font-size: 23px;
}

.panel p {
  line-height: 1.5;
}

label {
  display: block;
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd4e2;
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  color: #172033;
  background: #fff;
}

input:focus,
select:focus {
  outline: 3px solid rgba(63, 111, 214, .16);
  border-color: #4777d4;
}

.password-row {
  display: flex;
  gap: 10px;
}

.password-row input {
  min-width: 0;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.primary {
  background: #245dcc;
  color: #fff;
}

.primary:hover {
  background: #194cae;
}

.secondary {
  background: #edf1f7;
  color: #26344d;
}

.secondary:hover:not(:disabled) {
  background: #e1e8f2;
}

/* DASHBOARD */

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

.dashboard-toolbar p {
  margin: 0;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* BALANCE CARD */

.balance-card {
  padding: 28px;
  margin-bottom: 22px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(125deg, #173d86, #2868d8);
  box-shadow: 0 12px 28px rgba(36, 93, 204, .18);
}

.balance-top,
.balance-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .78);
}

.balance-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .15);
  font-weight: 800;
  font-size: 20px;
}

.balance-amount {
  margin: 18px 0 20px;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 800;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

.balance-bottom {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
}

/* ADD CONTRIBUTION */

.add-panel,
.history-panel {
  margin-bottom: 22px;
}

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

.section-heading p {
  margin: 0;
  font-size: 14px;
}

.add-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f7ee;
  color: #168047;
  font-size: 24px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

.form-field label {
  margin-top: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* HISTORY TABLE */

.history-heading {
  margin-bottom: 22px;
}

.count-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: #edf3ff;
  color: #245dcc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

thead {
  background: #f7f9fc;
}

th {
  padding: 14px 15px;
  color: #66738b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

td {
  padding: 16px 15px;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
}

tbody tr:hover {
  background: #fafbfd;
}

.amount-column {
  text-align: right;
  font-weight: 700;
  color: #17643a;
}

.empty-state {
  padding: 35px 15px;
  text-align: center;
  color: #778198;
}

/* PAGINATION */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  color: #65718a;
  font-size: 13px;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.pagination-buttons button {
  font-size: 13px;
}

/* MESSAGES */

.message {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.message.error {
  color: #a12a2a;
}

.message.success {
  color: #17643a;
}

.last-saved {
  margin: 0 4px 20px;
  color: #778198;
  font-size: 12px;
}

footer {
  margin: 24px 4px;
  color: #778198;
  font-size: 12px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

/* RESPONSIVE */

@media (max-width: 750px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 600px) {
  .shell {
    width: min(100% - 24px, 1100px);
    margin: 24px auto;
  }

  .topbar,
  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1;
  }

  .password-row {
    flex-direction: column;
  }

  .password-row button {
    width: 100%;
  }

  .panel {
    padding: 18px;
  }

  .balance-card {
    padding: 22px;
  }

  .balance-amount {
    font-size: 32px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field:first-child {
    grid-column: auto;
  }

  .form-actions button {
    width: 100%;
  }

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

  .pagination-buttons {
    width: 100%;
  }

  .pagination-buttons button {
    flex: 1;
  }

  .section-heading {
    align-items: flex-start;
  }
}

.actions-column {
  text-align: center;
  white-space: nowrap;
}

.delete-button {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #f3caca;
  border-radius: 8px;
  background: #fff1f1;
  color: #b42323;
  font-size: 13px;
  cursor: pointer;
}

.delete-button:hover:not(:disabled) {
  background: #ffe0e0;
}

.edit-button {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #bcd3f7;
  border-radius: 8px;
  background: #edf3ff;
  color: #1d4ed8;
  font-size: 13px;
  cursor: pointer;
}

.edit-button:hover:not(:disabled) {
  background: #dbe8ff;
}

.actions-column button + button {
  margin-left: 8px;
}

.editing-row {
  background: #fff8e6;
}

.text-center {
  text-align: center;
}

.export-actions {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

/* PRINT / PDF EXPORT */

@media print {
  .export-actions,
  .toolbar-actions,
  .projects-shortcut,
  button {
    display: none !important;
  }

  body, .shell {
    margin: 0;
    width: 100%;
  }

  .panel,
  .balance-card {
    box-shadow: none;
    border: 1px solid #ddd;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    break-inside: avoid;
  }

  details.literature {
    display: block;
  }

  details.literature > summary {
    list-style: none;
  }

  details.literature > summary::-webkit-details-marker {
    display: none;
  }

  details.literature > *:not(summary) {
    display: block !important;
  }

  input,
  select {
    border: none;
    background: transparent;
    padding: 4px 0;
    -webkit-appearance: none;
    appearance: none;
  }

  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

/* NAV LINKS */

.nav-link {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}

/* PROJECTS */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-card h2 {
  margin-top: 4px;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
}

.project-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 14px;
  background: #edf3ff;
  font-size: 24px;
}

.project-link {
  display: inline-block;
  margin-top: 16px;
  text-decoration: none;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.project-gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(26, 43, 74, .045);
}

.project-gallery img.plan-image {
  aspect-ratio: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e1e7f0;
  padding: 16px;
}

@media (min-width: 900px) {
  .project-gallery img.plan-image {
    padding: 40px;
  }
}

/* BUSINESS PLAN PLACEHOLDER */

.business-plan-placeholder {
  text-align: center;
  padding: 60px 25px;
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #edf3ff;
  font-size: 26px;
}

/* BUSINESS PLAN CALCULATOR */

.result-status {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .9);
  font-weight: 700;
}

.table-input {
  width: 120px;
  padding: 8px 10px;
  text-align: right;
}

.scenario-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

details.literature {
  margin-bottom: 16px;
  cursor: default;
}

details.literature summary {
  cursor: pointer;
  font-weight: 700;
  color: #245dcc;
}

details.literature[open] summary {
  margin-bottom: 12px;
}

details.literature ul {
  margin: 0;
  padding-left: 20px;
}

details.literature li {
  margin-bottom: 6px;
  line-height: 1.5;
}

details.literature li:last-child {
  margin-bottom: 0;
}



