:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827; background: #f3f4f9; font-synthesis: none;
  --app-blue: #2f55e7; --app-blue-soft: #e9efff; --app-surface: #fff;
  --app-muted: #7b8494; --app-line: #e7e9ef;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.top {
  height: 76px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--app-line);
  display: flex; justify-content: space-between; align-items: center; padding: 0 5vw;
  position: sticky; top: 0; z-index: 15; backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #102b58; font-size: 22px; font-weight: 800; }
.logo { width: 42px; height: 42px; border-radius: 11px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.page { width: min(1120px, 92vw); margin: 34px auto; }
.card { background: white; border: 1px solid var(--app-line); border-radius: 24px; box-shadow: 0 8px 28px rgba(30,50,90,.045); }
.auth { width: min(440px, 92vw); margin: 7vh auto; padding: 30px; }
.auth h1 { margin: 18px 0 5px; }
.muted { color: #6d7d94; font-size: 14px; }
.stack { display: grid; gap: 13px; margin-top: 22px; }
.contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.message-contacts {
  display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px;
  margin: 12px 0; padding: 12px; border-radius: 10px; background: #f5f7fb; font-size: 13px;
}
.message-contacts dt { color: #6d7d94; }
.message-contacts dd { margin: 0; overflow-wrap: anywhere; }
.message-contacts a { color: #2455eb; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; }
input, select, textarea { border: 1px solid #cbd6e5; border-radius: 9px; padding: 11px 12px; background: white; color: #132a4e; }
textarea { width: 100%; min-height: 92px; resize: vertical; }
.primary, .secondary, .link {
  border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 750;
}
.primary { background: var(--app-blue); color: white; }
.secondary { background: #edf2fb; color: #17345e; }
.link { background: transparent; color: #2455eb; padding: 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.portal-link { display: block; text-align: center; text-decoration: none; margin-top: 18px; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.error, .success, .info { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.error { color: #a12626; background: #fff0f0; border: 1px solid #ffcaca; }
.success { color: #146c36; background: #ecf9f0; border: 1px solid #bfe9ca; }
.info { color: #174f9e; background: #eaf2ff; border: 1px solid #c8dafb; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.hero h1 { margin: 0 0 6px; font-size: 38px; letter-spacing: -.045em; }
.applications { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 15px; }
.application { padding: 19px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.application:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(20,50,90,.1); }
.application h2 { font-size: 17px; margin: 0; }
.applicant-card { padding: 19px; }
.applicant-card h2 { font-size: 17px; margin: 0 0 4px; }
.applicant-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: #6d7d94; font-size: 13px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pill { background: #eaf0ff; color: #2455eb; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 750; }
.empty { text-align: center; padding: 60px 25px; }
.modal { position: fixed; inset: 0; background: rgba(7,24,51,.45); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal-card { width: min(520px, 100%); padding: 25px; max-height: 90vh; overflow: auto; }
.modal-card h2 { margin-top: 0; }
.detail-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.section { padding: 21px; margin-bottom: 18px; }
.section h2 { font-size: 18px; margin: 0 0 15px; }
.item { padding: 13px 0; border-top: 1px solid #edf1f6; }
.item:first-of-type { border-top: 0; }
.item-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.check { color: #128141; font-weight: 800; }
.pending { color: #7a8799; }
.timeline { border-left: 2px solid #d9e3f1; padding-left: 17px; margin-left: 7px; }
.timeline .item { position: relative; }
.timeline .item::before { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #2455eb; left: -23px; top: 18px; }
.address { background: #f0f5ff; border: 1px solid #cfddfb; }
.fees { display: grid; gap: 8px; }
.total { border-top: 1px solid #dce4ef; padding-top: 10px; font-size: 18px; font-weight: 800; }
.back { margin-bottom: 16px; }
.progress { width: 22px; height: 22px; border: 3px solid #d7e0ed; border-top-color: #2455eb; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.account-layout { display: grid; grid-template-columns: 270px 1fr; min-height: calc(100vh - 76px); }
.account-sidebar { background: #fff; border-right: 1px solid var(--app-line); padding: 28px 18px; }
.account-person { display: flex; gap: 11px; align-items: center; padding: 8px 9px 22px; border-bottom: 1px solid #edf1f6; margin-bottom: 16px; }
.account-person strong, .account-person span { display: block; overflow: hidden; text-overflow: ellipsis; }
.account-person span { max-width: 150px; color: #7b899c; font-size: 11px; margin-top: 3px; }
.avatar { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #e7edff; color: #2455eb; font-weight: 800; }
.account-nav { width: 100%; display: flex; gap: 11px; align-items: center; border: 0; background: transparent; color: #52627b; padding: 12px 13px; border-radius: 10px; margin-bottom: 5px; text-align: left; font-weight: 700; }
.account-nav span { color: #2455eb; width: 20px; text-align: center; }
.account-nav.active { background: var(--app-blue-soft); color: var(--app-blue); }
.account-content { min-width: 0; padding: 38px; }
.account-page { width: min(1180px, 100%); margin: 0 auto; }
.mobile-account-nav { display: none; }
.portal-list { display: grid; gap: 13px; }
.portal-row { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.portal-row-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal-row a { text-decoration: none; }
.receipt-detail { width: 100%; padding: 15px; background: #f7f9fd; border-radius: 10px; }
.receipt-detail h3 { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.toggles label { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.toggles input { width: 18px; height: 18px; }
.danger-zone { border-color: #f3c6c6; }
.danger-button { border: 0; border-radius: 9px; padding: 11px 14px; background: #b42318; color: #fff; font-weight: 750; }
.service-hub { margin-bottom: 18px; }
.service-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.service-links button {
  border: 1px solid var(--app-line); background: #fff; border-radius: 16px; min-height: 92px;
  padding: 16px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center;
  gap: 10px; color: #111827; text-align: left;
}
.service-links button:hover { border-color: #bdcafa; background: #f8faff; }
.service-links button span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--app-blue-soft); color: var(--app-blue); font-size: 19px; }
.service-links button strong { font-size: 14px; }
.service-links button i { color: #a5adba; font-size: 25px; font-style: normal; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .detail-layout { grid-template-columns: 1fr; }
  body { background: #f3f4f9; }
  .top { height: 64px; padding: 0 18px; background: #f3f4f9; border-bottom: 0; position: static; }
  .brand span { display: none; }
  .top .logo { width: 38px; height: 38px; }
  .page { margin-top: 22px; }
  .hero { align-items: start; flex-direction: column; }
  .hero h1 { font-size: 34px; }
  .account-layout { grid-template-columns: 1fr; padding-bottom: 76px; }
  .account-sidebar { display: none; }
  .account-content { padding: 22px 16px 38px; }
  .account-page { width: 100%; }
  .card { border: 0; border-radius: 24px; box-shadow: none; }
  .application, .applicant-card, .section { padding: 20px; }
  .applications { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .contact-fields { grid-template-columns: 1fr; }
  .mobile-account-nav {
    position: fixed; display: grid; grid-template-columns: repeat(4, 1fr);
    left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 30; background: rgba(255,255,255,.96);
    border: 1px solid #e1e4eb; border-radius: 26px; padding: 8px;
    box-shadow: 0 12px 35px rgba(20,50,90,.18); backdrop-filter: blur(18px);
  }
  .mobile-account-nav button { border: 0; background: transparent; color: #596170; display: grid; place-items: center; gap: 3px; padding: 7px 2px; border-radius: 18px; }
  .mobile-account-nav button span { font-size: 20px; line-height: 1; }
  .mobile-account-nav button small { font-size: 11px; font-weight: 700; }
  .mobile-account-nav button.active { background: var(--app-blue-soft); color: var(--app-blue); }
  .service-links { grid-template-columns: 1fr; gap: 0; }
  .service-links button { min-height: 62px; border: 0; border-bottom: 1px solid var(--app-line); border-radius: 0; padding: 10px 2px; }
  .service-links button:last-child { border-bottom: 0; }
  .portal-row { align-items: flex-start; }
}
