:root {
  --ink: #17251e;
  --muted: #68746d;
  --paper: #f5f4ef;
  --surface: #fff;
  --green: #1f513b;
  --green-2: #346b52;
  --mint: #dce9de;
  --lime: #d9e7a8;
  --orange: #efb45f;
  --rose: #e9a8a0;
  --line: #dedfd8;
  --shadow: 0 16px 50px rgba(33, 50, 41, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 22px 24px;
  background: var(--ink);
  color: #f8f6ed;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: .02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #8fa399;
  border-radius: 50% 50% 50% 12px;
  color: var(--lime);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
}
.main-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px 13px;
  background: transparent;
  color: #aebdb5;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #f8f6ed; color: var(--ink); font-weight: 700; }
.nav-icon { width: 28px; display: inline-block; text-align: center; font-size: 17px; }
.sidebar-card {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255,255,255,.035);
}
.sidebar-card strong { display: block; margin: 7px 0 5px; font-family: Georgia, serif; font-size: 18px; }
.sidebar-card p { color: #9fb0a7; font-size: 12px; line-height: 1.5; margin: 0 0 14px; }
.progress-track { height: 5px; background: #3d4d45; border-radius: 9px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--lime); transition: width .4s ease; }
.sidebar-card small { display: block; color: #92a49a; font-size: 10px; margin-top: 8px; }
.sidebar-footer { display: grid; gap: 7px; margin-top: 22px; color: #778a80; font-size: 10px; }
.sidebar-footer .text-button { color: #c4d0ca; text-align: left; }

main { min-width: 0; }
.topbar {
  min-height: 92px;
  padding: 20px clamp(24px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(245,244,239,.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.date-label, .eyebrow, .section-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--green-2);
}
.header-copy h1 { margin: 5px 0 0; font: 22px/1.1 Georgia, serif; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.search-box {
  width: clamp(180px, 20vw, 260px);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  background: #fff;
  color: var(--muted);
}
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.primary-btn, .secondary-btn, .danger-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.primary-btn { background: var(--green); color: #fff; box-shadow: 0 5px 16px rgba(31,81,59,.18); }
.primary-btn:hover { background: #163e2d; transform: translateY(-1px); }
.primary-btn span { margin-right: 5px; }
.secondary-btn { border: 1px solid var(--line); background: #fff; }
.danger-btn { background: #f8e5e2; color: #8a332c; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--green); font-weight: 750; cursor: pointer; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

.content { padding: 44px clamp(24px, 4vw, 56px) 70px; max-width: 1500px; margin: 0 auto; }
.view { display: none; animation: fadeIn .22s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
.hero-row { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 32px; }
.hero-row h2, .view-heading h2 {
  font: clamp(34px, 4vw, 52px)/.98 Georgia, serif;
  letter-spacing: -.025em;
  margin: 10px 0 0;
}
.hero-note { max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }
.view-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.view-heading p { color: var(--muted); margin: 9px 0 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 135px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; right: -21px; bottom: -30px; background: var(--accent, var(--mint)); opacity: .7; }
.metric-card .metric-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card .metric-value { display: block; margin-top: 15px; font: 36px/1 Georgia, serif; }
.metric-card .metric-note { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.metric-card .metric-icon { color: var(--green); font-size: 17px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 24px 18px; }
.panel-header h3 { font: 25px/1 Georgia, serif; margin: 7px 0 0; }
.college-list { padding: 0 12px 12px; }
.college-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 100px 88px; align-items: center; gap: 14px; padding: 14px 12px; border-top: 1px solid #ecece7; cursor: pointer; border-radius: 8px; }
.college-row:hover { background: #fafaf6; }
.college-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.college-identity > div { min-width: 0; }
.school-monogram { flex: 0 0 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--school-color, var(--mint)); color: var(--ink); font: 18px Georgia, serif; }
.college-identity strong, .college-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.college-identity small, .row-stat small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.row-stat strong { display: block; font-size: 13px; }
.college-row > .status-pill { justify-self: start; max-width: 88px; white-space: nowrap; }
.status-pill, .type-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-researching { background: #edf0ed; color: #65716a; }
.status-in-progress { background: #fff0d7; color: #8a5a19; }
.status-applied { background: #dce9de; color: #245941; }
.status-accepted { background: #d8edc0; color: #3f681f; }
.status-waitlisted { background: #eee5fb; color: #704c9d; }
.status-denied { background: #f8e0dd; color: #9a4038; }
.favorite-btn { border: 0; background: transparent; font-size: 20px; color: #bdc4be; cursor: pointer; }
.favorite-btn.active { color: #d18b2b; }

.deadline-panel { padding-bottom: 9px; }
.deadline-item { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; margin: 0 12px; padding: 15px 12px; border-top: 1px solid #ecece7; }
.date-block { text-align: center; border-radius: 9px; background: var(--paper); padding: 7px 4px; }
.date-block strong, .date-block small { display: block; }
.date-block strong { font: 19px Georgia, serif; }
.date-block small { font-size: 8px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.deadline-item > div:nth-child(2) strong { display: block; font-size: 12px; }
.deadline-item > div:nth-child(2) small { color: var(--muted); font-size: 10px; }
.days-left { font-size: 10px; color: var(--muted); white-space: nowrap; }

.segmented { padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #ecece6; }
.segmented button { border: 0; border-radius: 7px; padding: 8px 13px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 5px rgba(0,0,0,.07); }
.college-card-grid { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 17px; }
.college-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.college-card:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(33,50,41,.12); }
.college-card-top { height: 8px; background: var(--school-color); }
.college-card-body { padding: 20px; }
.card-title-row { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.card-title-row h3 { font: 23px/1.1 Georgia, serif; margin: 14px 0 4px; }
.card-location { color: var(--muted); font-size: 12px; }
.college-card-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 17px 0; margin: 17px 0; border-top: 1px solid #ecece7; border-bottom: 1px solid #ecece7; }
.college-card-stats strong, .college-card-stats small { display: block; }
.college-card-stats strong { font-size: 13px; }
.college-card-stats small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.college-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-link { color: var(--green); text-decoration: none; font-size: 11px; font-weight: 800; }
.card-link:hover { text-decoration: underline; }
.edit-btn { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px 10px; font-size: 10px; font-weight: 700; cursor: pointer; }

.table-panel { overflow: hidden; box-shadow: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 14px 20px; background: #edeee8; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
td { padding: 17px 20px; border-top: 1px solid #ecece7; font-size: 12px; }
td strong { display: block; }
td small { color: var(--muted); }
.mini-progress { width: 120px; height: 7px; background: #e4e6e1; border-radius: 9px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; background: var(--green-2); border-radius: inherit; }
.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 18px; }
.finance-card { border-radius: var(--radius); padding: 22px; color: var(--ink); background: var(--mint); }
.finance-card:nth-child(2) { background: #f2dfbd; }
.finance-card:nth-child(3) { background: #e4dceb; }
.finance-card small, .finance-card strong { display: block; }
.finance-card small { font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.finance-card strong { margin-top: 12px; font: 30px Georgia, serif; }
.finance-card span { font-size: 11px; color: var(--muted); }

.security-note { display: flex; gap: 14px; padding: 17px 19px; border: 1px solid #cbdacb; border-radius: 14px; background: #eaf2e9; margin-bottom: 20px; }
.security-note > span { font-size: 22px; color: var(--green); }
.security-note strong { font-size: 13px; }
.security-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.login-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.login-card .school-monogram { width: 46px; height: 46px; }
.login-card strong, .login-card small { display: block; }
.login-card small { color: var(--muted); margin-top: 4px; }
.login-actions { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-decoration: none; color: var(--ink); display: grid; place-items: center; }

.empty-state { padding: 70px 20px; text-align: center; border: 1px dashed #cdd0c8; border-radius: var(--radius); color: var(--muted); }
.empty-state > span { font-size: 30px; }
.empty-state h3 { color: var(--ink); margin: 10px 0 5px; }
.empty-state p { margin: 0; font-size: 13px; }
.hidden { display: none !important; }

dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 30px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(11,28,20,.3); }
dialog::backdrop { background: rgba(16,33,25,.55); backdrop-filter: blur(3px); }
#collegeForm { padding: 27px; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; margin-bottom: 23px; }
.dialog-header h2 { font: 34px Georgia, serif; margin: 6px 0 0; }
.close-btn { border: 0; background: #f0f0eb; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: grid; gap: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #48544d; }
.field-help { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #d9dcd5; border-radius: 9px; padding: 10px 11px; background: #fafaf7; outline: none; color: var(--ink); }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(52,107,82,.1); }
.form-grid textarea { resize: vertical; }
.span-2 { grid-column: span 2; }
.dialog-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-actions { display: flex; gap: 9px; margin-left: auto; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 99; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; box-shadow: var(--shadow); transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .college-card-grid { grid-template-columns: repeat(2,1fr); }
  .college-row { grid-template-columns: minmax(0, 1fr) 78px 88px; }
  .college-row .hide-tablet { display: none; }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 246px; transition: transform .25s ease; box-shadow: 12px 0 45px rgba(0,0,0,.22); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { padding: 16px 20px; min-height: 76px; }
  .topbar-actions .search-box { display: none; }
  .topbar-actions .primary-btn { font-size: 0; width: 42px; height: 42px; padding: 0; }
  .topbar-actions .primary-btn span { font-size: 23px; margin: 0; }
  .content { padding: 32px 20px 60px; }
  .hero-row { display: block; }
  .hero-note { margin-top: 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
  .finance-summary { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-copy h1 { font-size: 18px; }
  .date-label { font-size: 8px; }
  .metric-grid, .college-card-grid { grid-template-columns: 1fr; }
  .hero-row h2, .view-heading h2 { font-size: 38px; }
  .view-heading { align-items: start; flex-direction: column; }
  .college-row { grid-template-columns: minmax(0, 1fr) auto; }
  .college-row .row-stat { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  #collegeForm { padding: 21px; }
  .dialog-footer { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions { margin: 0; }
  .dialog-actions button { flex: 1; }
}
