@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #101610;
  --surface: #182119;
  --surface-raised: #202b21;
  --border: #2b382d;
  --text: #f0f3ea;
  --muted: #a4afa2;
  --green: #84c77b;
  --green-deep: #264b2a;
  --gold: #e7c56e;
  --red: #e58b83;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

.topbar {
  min-height: 76px; padding: 14px max(24px, calc((100% - 1180px) / 2));
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: #141c15; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; gap: 12px; align-items: center; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: #152015; background: var(--gold); font: 800 14px "Manrope", sans-serif;
}
.brand strong, .brand small { display: block; }
.brand strong { font: 800 14px "Manrope", sans-serif; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.account-area { display: flex; align-items: center; gap: 10px; }
.account-label { color: var(--muted); font-size: 13px; }
.role-badge { border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; }
.role-badge.admin { background: rgba(231, 197, 110, .16); color: var(--gold); }
.role-badge.student { background: #343d3a; color: #c4cec7; }
.main-content { width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: calc(100vh - 146px); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 18px 0 24px; border-bottom: 1px solid var(--border); }
.tab { flex: 0 0 auto; padding: 10px 15px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 600; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: #b7e5ad; background: var(--green-deep); }
.page { padding: 30px 0 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Manrope", sans-serif; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
.page-heading .muted { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel, .idea-card {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.stat-card { min-height: 142px; padding: 21px; }
.stat-card > span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin: 13px 0 5px; font: 700 clamp(24px, 3vw, 32px) "Manrope", sans-serif; }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-highlight { border-color: #426a3d; background: linear-gradient(135deg, #1d2b1d, #182119); }
.stat-highlight strong { color: var(--green); }
.panel { padding: 22px; margin-bottom: 18px; }
.goal-panel { padding: 22px 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.goal-percent { color: var(--gold); font: 700 20px "Manrope", sans-serif; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #2b362b; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #70b966, #dfc36d); transition: width .3s ease; }
.goal-panel > .muted { margin: 10px 0 0; font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
td { padding: 14px 12px; border-top: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
td.amount { white-space: nowrap; color: var(--green); font-weight: 700; }
.empty-state { padding: 30px 16px; color: var(--muted); text-align: center; font-size: 14px; }
.entry-form h2 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.span-two { grid-column: span 2; }
label { display: grid; gap: 7px; color: #d7dfd4; font-size: 12px; font-weight: 600; }
input, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #364337; border-radius: 8px;
  outline: none; color: var(--text); background: #111812; font-size: 14px;
}
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(132, 199, 123, .12); }
textarea { resize: vertical; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: 13px; transition: .15s ease; }
.button-primary { background: var(--green); color: #142014; }
.button-primary:hover { background: #9bd18e; }
.button-secondary { border-color: #405542; color: #c5e0bd; background: #233225; }
.button-secondary:hover { background: #2c4030; }
.button-quiet { border-color: var(--border); color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--text); background: var(--surface-raised); }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button-danger { color: #ffd2cd; border-color: #6b3936; background: #482724; }
.button-danger:hover { background: #60312c; }
.button-full { width: 100%; }
.row-actions { display: flex; gap: 7px; white-space: nowrap; }
.row-actions .button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.bill-link { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.idea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.idea-card { display: flex; flex-direction: column; padding: 20px; }
.idea-card h2 { margin-bottom: 9px; }
.idea-card p { color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.idea-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; }
.vote-count { color: var(--gold); font-size: 12px; font-weight: 700; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; margin-left: 9px; padding: 0 0 24px 24px; border-left: 1px solid #405542; }
.timeline-item::before { position: absolute; top: 4px; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); content: ""; }
.timeline-item h2 { margin-bottom: 7px; }
.timeline-item time { display: block; margin-bottom: 8px; color: var(--gold); font-size: 12px; }
.timeline-item p { color: var(--muted); font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-grid .panel { margin: 0; }
.form-stack { display: grid; gap: 15px; }
.form-stack h2 { margin-bottom: 2px; }
.danger-panel { border-color: #583633; }
.danger-panel h2 { margin-bottom: 10px; }
.danger-panel p { margin-bottom: 15px; }
.notice { margin-top: 18px; padding: 12px 15px; border-radius: 8px; font-size: 13px; }
.notice-warn { color: #e8d59f; border: 1px solid #685b36; background: #302b1d; }
.message { min-height: 18px; margin: 10px 0 0; font-size: 13px; }
.message.error { color: var(--red); }
.message.success { color: var(--green); }
.app-message { margin: 0; }
footer { padding: 24px; border-top: 1px solid var(--border); color: var(--muted); text-align: center; font-size: 12px; letter-spacing: .08em; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0%, #233323 0, var(--bg) 58%); }
.login-card { width: min(100%, 430px); padding: 35px; border: 1px solid var(--border); border-radius: 16px; background: rgba(24, 33, 25, .96); box-shadow: 0 20px 60px rgba(0, 0, 0, .28); }
.brand-login { margin-bottom: 32px; }
.login-card h1 { font-size: 29px; }
.login-card > .muted { margin-bottom: 23px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: #778277; font-size: 11px; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; background: var(--border); content: ""; }
code { color: var(--gold); }

@media (max-width: 700px) {
  .topbar { align-items: flex-start; padding: 13px 18px; }
  .account-area { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .account-label { display: block; font-size: 11px; }
  .main-content { width: calc(100% - 32px); }
  .tabs { margin: 0 -16px; padding: 14px 16px 18px; }
  .tab { padding: 9px 12px; font-size: 12px; }
  .page { padding-top: 23px; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { min-height: 0; padding: 17px; }
  .stat-card strong { margin: 8px 0 3px; }
  .panel { padding: 17px; }
  .idea-grid, .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  th, td { padding-right: 10px; padding-left: 10px; }
  .login-card { padding: 27px 22px; }
}
