:root {
  --navy: #061d37;
  --navy-2: #0a2d51;
  --blue: #138fe0;
  --blue-2: #08a9ee;
  --ink: #0d2039;
  --muted: #61748d;
  --line: #dce6f0;
  --soft: #f4f8fc;
  --white: #fff;
  --green: #177451;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(6, 29, 55, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 1000; background: #fff; padding: .75rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }
.portal-shell { width: min(1360px, calc(100% - 36px)); margin-inline: auto; }

.site-topbar { background: #04182f; color: #fff; }
.site-topbar__inner { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-topbar__left { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.site-topbar a { color: #fff; text-decoration: none; font-size: .84rem; font-weight: 600; }
.site-topbar a:hover { text-decoration: underline; }
.site-topbar__right { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: #d8e6f3; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.site-header__inner { min-height: 122px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-logo { display: inline-flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.site-logo img { width: 176px; height: auto; display: block; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.site-nav a { padding: .6rem .35rem; color: var(--ink); font-size: .95rem; font-weight: 800; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--blue); }
.site-nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.site-nav .portal-link { color: #435972; font-size: .9rem; }
.site-nav .portal-link.active { color: var(--navy); border-bottom-color: var(--navy); }
.btn--nav { min-height: 56px; padding: .92rem 1.5rem; border-radius: 14px; color: #fff !important; background: linear-gradient(135deg, var(--blue), var(--blue-2)); border-bottom: 0 !important; box-shadow: 0 14px 34px rgba(19,143,224,.20); }
.btn--nav:hover { filter: brightness(.97); transform: translateY(-1px); }
.portal-menu { display: none; border: 0; border-radius: 9px; background: var(--navy); color: #fff; padding: .65rem .85rem; font-weight: 800; }

.account-strip { background: #edf5fb; border-bottom: 1px solid var(--line); }
.account-strip__inner { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; gap: .7rem; font-size: .88rem; color: #4b6079; }
.role-pill { display: inline-flex; padding: .15rem .55rem; border-radius: 999px; color: #fff; background: var(--navy-2); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.portal-hero { color: #fff; background: radial-gradient(circle at 75% 20%, rgba(19,143,224,.24), transparent 25rem), linear-gradient(120deg, #05192f, #0a2d51); }
.portal-hero__inner { min-height: 320px; padding-block: 62px; display: grid; align-content: center; }
.breadcrumb { margin: 0 0 1rem; color: #b9d5ee; }
.portal-hero h1 { max-width: 900px; margin: 0; font-size: clamp(2.55rem, 7vw, 5rem); line-height: .98; letter-spacing: -.055em; }
.portal-hero p:last-child { max-width: 720px; margin: 1.25rem 0 0; font-size: 1.08rem; color: #e5f1fb; }
.portal-main-section { padding: 58px 0 80px; min-height: 460px; background: linear-gradient(#fff, #f9fbfd); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.035em; }
.section-heading p { margin: .35rem 0 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 1.35rem; }
.project-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.project-card__image { position: relative; height: 215px; overflow: hidden; background: var(--navy); }
.project-card__image > img.cover { width: 100%; height: 100%; object-fit: cover; opacity: .70; }
.project-card__image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,18,34,.88), rgba(4,18,34,.05) 65%); }
.project-card__logo { position: absolute; z-index: 2; left: 20px; bottom: 17px; width: min(88%, 420px); max-height: 86px; object-fit: contain; object-position: left center; padding: 8px 12px; border-radius: 9px; background: rgba(255,255,255,.94); }
.project-card__body { padding: 1.35rem; }
.status { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .7rem; color: var(--green); font-size: .75rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.project-card h3 { margin: 0; font-size: 1.5rem; letter-spacing: -.025em; }
.project-card p { margin: .65rem 0 1.15rem; color: var(--muted); }
.project-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding: .9rem 0 1.15rem; border-top: 1px solid var(--line); }
.project-meta span { color: var(--muted); font-size: .78rem; }
.project-meta strong { display: block; color: var(--ink); font-size: .9rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 45px; padding: .72rem 1rem; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2)); text-decoration: none; font-weight: 850; cursor: pointer; box-shadow: 0 10px 24px rgba(19,143,224,.20); }
.btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.btn--secondary { color: var(--navy); background: #eef5fb; box-shadow: none; }
.btn--danger { background: var(--red); box-shadow: none; }
.btn--small { min-height: 36px; padding: .48rem .7rem; font-size: .82rem; }
.empty-state, .panel { background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.empty-state { padding: 2rem; text-align: center; }
.panel { padding: clamp(1.2rem, 3vw, 2rem); }
.panel h2, .panel h3 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .38rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 800; font-size: .9rem; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #cdd9e5; border-radius: 9px; padding: .78rem .85rem; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(19,143,224,.16); border-color: var(--blue); }
.help { color: var(--muted); font-size: .82rem; }
.form-actions { margin-top: 1rem; display: flex; gap: .75rem; align-items: center; }
.alert { margin-bottom: 1rem; padding: .85rem 1rem; border-radius: 9px; background: #fff1f0; border: 1px solid #f6c7c3; color: #8c1d18; }
.flash-wrap { padding-top: 1rem; }
.flash { padding: .85rem 1rem; border-radius: 9px; border: 1px solid var(--line); }
.flash--success { color: #0f6846; background: #edf9f4; border-color: #bce6d3; }
.flash--error { color: #8c1d18; background: #fff1f0; border-color: #f6c7c3; }
.login-shell { min-height: calc(100vh - 176px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); }
.login-story { padding: clamp(2rem, 6vw, 6rem); display: grid; align-content: center; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(19,143,224,.29), transparent 23rem), linear-gradient(135deg, #05182d, #0a3158); }
.login-story .breadcrumb { color: #b6d7f0; }
.login-story h1 { margin: 0; font-size: clamp(3rem, 7vw, 5.5rem); line-height: .93; letter-spacing: -.06em; }
.login-story p { max-width: 620px; color: #e5f1fb; font-size: 1.08rem; }
.login-panel-wrap { padding: clamp(1.5rem, 5vw, 5rem); display: grid; place-items: center; background: #f7fafc; }
.login-panel { width: min(100%, 480px); padding: clamp(1.4rem, 4vw, 2.3rem); background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.login-panel h2 { margin: 0 0 .35rem; font-size: 1.8rem; letter-spacing: -.03em; }
.login-panel > p { margin: 0 0 1.3rem; color: var(--muted); }
.login-panel .field + .field { margin-top: .9rem; }
.login-panel .btn { width: 100%; margin-top: 1rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .85rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #52667e; background: #f4f8fb; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; }
.ticket { padding: 1.15rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ticket + .ticket { margin-top: .85rem; }
.ticket__top { display: flex; justify-content: space-between; gap: 1rem; }
.ticket h3 { margin: 0; }
.ticket p { color: #455b74; white-space: pre-wrap; }
.portal-footer { color: #c7d8e8; background: var(--navy); }
.portal-footer__inner { min-height: 115px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.portal-footer strong, .portal-footer span { display: block; }
.portal-footer a { color: #fff; }
.small-note { color: var(--muted); font-size: .85rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .65rem; }
.check { display: flex; align-items: center; gap: .55rem; padding: .7rem; border: 1px solid var(--line); border-radius: 9px; }

@media (max-width: 1200px) {
  .site-header__inner { min-height: 108px; align-items: center; }
  .site-nav { gap: .55rem; }
  .site-nav a { font-size: .9rem; }
  .site-nav .portal-link { font-size: .85rem; }
}
@media (max-width: 980px) {
  .portal-menu { display: inline-flex; }
  .site-nav.portal-nav { position: absolute; left: 18px; right: 18px; top: 170px; display: none; padding: 1rem; flex-direction: column; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
  .site-nav.portal-nav.open { display: flex; }
  .site-nav.portal-nav a { padding: .8rem; border-bottom: 0; border-radius: 8px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-story { min-height: 360px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .portal-footer__inner { padding-block: 1.5rem; align-items: flex-start; flex-direction: column; gap: 1rem; }
}
@media (max-width: 700px) {
  .site-topbar__inner, .site-header__inner { gap: .75rem; }
  .site-topbar__inner { min-height: auto; padding: .75rem 0; flex-direction: column; align-items: flex-start; }
  .site-topbar__left { gap: .85rem 1.25rem; }
  .site-topbar__right { font-size: .75rem; }
  .site-header__inner { min-height: 94px; }
  .site-logo img { width: 150px; }
}
@media (max-width: 560px) {
  .portal-shell { width: min(100% - 24px, 1360px); }
  .site-header__inner { min-height: 82px; }
  .site-logo img { width: 132px; }
  .site-nav.portal-nav { top: 154px; }
  .portal-hero__inner { min-height: 270px; padding-block: 42px; }
  .account-strip__inner { justify-content: space-between; }
  .project-meta { grid-template-columns: 1fr; }
  .button-row .btn { width: 100%; }
  .login-story, .login-panel-wrap { padding: 1.35rem; }
  .login-story h1 { font-size: 3.25rem; }
}
