.auth-page, .portal-page { min-height: 100vh; background: #f5f8ff; }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .92fr) minmax(560px, 1.08fr); }
.auth-brand-panel { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: clamp(48px, 7vw, 105px); background: #10233f; color: #fff; }
.auth-brand { display: flex; align-items: center; gap: 22px; color: #fff; text-decoration: none; }
.auth-brand img { width: 68px; height: 68px; padding: 8px; border-radius: 14px; background: #fff; object-fit: contain; }
.auth-brand span { display: grid; gap: 9px; }
.auth-brand strong { font: 800 clamp(2rem, 3vw, 3.2rem)/1 "Manrope", sans-serif; letter-spacing: .11em; }
.auth-brand small { color: #c6d2e1; font-size: .83rem; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; }
.auth-benefits { display: grid; gap: 0; max-width: 620px; margin-top: 70px; border-top: 1px solid rgba(255,255,255,.18); }
.auth-benefits article { display: grid; grid-template-columns: 54px 1fr; gap: 22px; align-items: start; padding: 27px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.auth-benefit-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(102,236,187,.55); border-radius: 14px; background: rgba(82,228,168,.09); color: #78efbd; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.12); }
.auth-benefit-icon svg { width: 25px; height: 25px; overflow: visible; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.auth-benefit-icon .auth-icon-accent { stroke: #5f8cff; stroke-width: 2; }
.auth-benefits strong { font: 700 1.03rem "Manrope", sans-serif; }
.auth-benefits p { max-width: 390px; margin: 3px 0 0; color: #c6d2e1; font-size: .9rem; }
.auth-form-panel { display: grid; min-height: 100vh; padding: 34px 55px; place-items: center; background: #fff; }
.auth-card { width: min(100%, 580px); }
.auth-card h1 { margin-bottom: 16px; font-size: clamp(2.7rem, 4.3vw, 3.8rem); }
.auth-intro { max-width: 540px; margin-bottom: 28px; color: #5d6b7f; font-size: 1.04rem; }
.auth-setup { margin-bottom: 26px; padding: 16px 18px; border-left: 4px solid #f0a828; background: #fff8e8; color: #553600; }
.auth-setup p { margin: 3px 0 0; font-size: .88rem; }
.auth-form { display: grid; gap: 17px; }
.auth-form h2 { margin: 0; font-size: 2rem; }
.auth-form > p { color: #5d6b7f; }
.auth-form label { display: grid; gap: 8px; font-weight: 700; }
.auth-form input, .request-dialog input, .request-dialog select, .request-dialog textarea { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #cbd6e6; border-radius: 9px; background: #fff; color: #10233f; font: inherit; outline: 0; }
.auth-form input:focus, .request-dialog input:focus, .request-dialog select:focus, .request-dialog textarea:focus { border-color: #356bff; box-shadow: 0 0 0 3px rgba(53,107,255,.14); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 85px; }
.password-field button { position: absolute; top: 50%; right: 12px; padding: 7px; border: 0; background: transparent; color: #356bff; cursor: pointer; font-size: .78rem; font-weight: 700; transform: translateY(-50%); }
.auth-forgot { justify-self: end; margin-top: -8px; padding: 0; border: 0; background: transparent; color: #356bff; cursor: pointer; font-weight: 700; }
.auth-submit { width: 100%; border: 0; cursor: pointer; }
.auth-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.auth-feedback { min-height: 1.4em; margin: -7px 0 0; color: #c43d2d !important; font-size: .86rem; text-align: center; }
.auth-feedback.success { color: #16855f !important; }
.auth-invite-note { margin: 23px auto 16px; color: #5d6b7f; font-size: .84rem; text-align: center; }
.auth-back { display: block; color: #356bff; font-weight: 700; text-align: center; text-decoration: none; }
.auth-security { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid #dbe3ef; color: #5d6b7f; font-size: .84rem; text-align: center; }
.auth-security span { color: #16855f; }

.portal-loading { position: fixed; z-index: 100; inset: 0; display: grid; align-content: center; justify-items: center; background: #f5f8ff; color: #5d6b7f; }
.portal-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.portal-loading span { width: 44px; height: 44px; border: 3px solid #dbe3ef; border-top-color: #356bff; border-radius: 50%; animation: portal-spin .8s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
.portal-shell { min-height: 100vh; }
.portal-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 220px; flex-direction: column; background: #10233f; color: #fff; }
.portal-brand { display: flex; height: 82px; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.portal-brand img { width: 42px; height: 42px; padding: 5px; border-radius: 9px; background: #fff; }
.portal-brand strong { font: 800 1.4rem "Manrope", sans-serif; letter-spacing: .08em; }
.portal-sidebar nav { display: grid; padding: 18px 0; }
.portal-sidebar nav button, .portal-sidebar nav a { display: flex; min-height: 55px; align-items: center; gap: 14px; padding: 0 24px; border: 0; border-left: 3px solid transparent; background: transparent; color: #d9e4f1; cursor: pointer; font: 600 .9rem "DM Sans", sans-serif; text-align: left; text-decoration: none; }
.portal-sidebar nav button:hover, .portal-sidebar nav a:hover, .portal-sidebar nav button.active { border-left-color: #74a0ff; background: #356bff; color: #fff; }
.portal-nav-icon { display: inline-grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border: 1px solid rgba(202,220,246,.18); border-radius: 9px; background: rgba(255,255,255,.06); color: #a9c1df; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); transition: background .18s, border-color .18s, color .18s, transform .18s; }
.portal-nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.portal-sidebar nav button:hover .portal-nav-icon, .portal-sidebar nav a:hover .portal-nav-icon, .portal-sidebar nav button.active .portal-nav-icon { border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.16); color: #fff; transform: translateX(1px); }
.portal-help { display: grid; gap: 2px; margin-top: auto; padding: 24px; border-top: 1px solid rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.portal-help strong { font: 700 .88rem "Manrope", sans-serif; }
.portal-help span { color: #82a7ff; font-size: .78rem; }
.portal-workspace { min-height: 100vh; margin-left: 220px; }
.portal-topbar { position: sticky; z-index: 15; top: 0; display: flex; height: 82px; align-items: center; padding: 0 30px; border-bottom: 1px solid #dbe3ef; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
.portal-menu { display: none; width: 38px; height: 38px; margin-right: 12px; place-items: center; border: 1px solid #dbe3ef; border-radius: 10px; background: #fff; color: #10233f; }
.portal-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.portal-company { display: flex; align-items: center; gap: 10px; }
.portal-company-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #d9e5ff; border-radius: 10px; background: linear-gradient(145deg, #f2f6ff, #e6edff); color: #356bff; box-shadow: inset 0 1px 0 #fff; }
.portal-company-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.portal-account { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.portal-account > div { display: grid; }
.portal-account small { max-width: 230px; overflow: hidden; color: #5d6b7f; font-size: .72rem; text-overflow: ellipsis; }
.portal-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #356bff; color: #fff; font-weight: 800; }
.portal-account button { margin-left: 12px; padding: 8px 11px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; color: #5d6b7f; cursor: pointer; font-size: .72rem; }
.portal-main { padding: 28px 30px; }
.portal-view { max-width: 1500px; margin-inline: auto; }
.portal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 23px; }
.portal-title-row h1 { margin-bottom: 6px; font-size: clamp(2rem, 2.8vw, 2.6rem); }
.portal-title-row p { margin: 0; color: #5d6b7f; }
.portal-title-row .button { min-height: 48px; flex: 0 0 auto; border: 0; cursor: pointer; }
.portal-status-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; border: 1px solid #dbe3ef; border-radius: 12px; background: #fff; }
.portal-status-strip article { display: grid; grid-template-columns: 48px 1fr; gap: 13px; align-items: center; min-height: 96px; padding: 16px 20px; border-right: 1px solid #dbe3ef; }
.portal-status-strip article:last-child { border-right: 0; }
.portal-status-strip article > .portal-metric-icon { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #dae5ff; border-radius: 13px; background: linear-gradient(145deg, #f2f6ff, #e7efff); color: #356bff; box-shadow: inset 0 1px 0 #fff, 0 7px 18px rgba(31,74,164,.07); }
.portal-status-strip article > .portal-metric-icon.status-good { border-color: #c7f2dc; background: linear-gradient(145deg, #e9fff4, #d9f8e8); color: #16855f; }
.portal-metric-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.portal-status-strip strong, .portal-status-strip small { display: block; }
.portal-status-strip strong { font: 700 1.05rem "Manrope", sans-serif; }
.portal-status-strip small { margin-top: 2px; color: #5d6b7f; font-size: .75rem; }
.portal-chart-panel, .portal-data-panel { border: 1px solid #dbe3ef; border-radius: 12px; background: #fff; }
.portal-chart-panel { padding: 25px; }
.portal-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.portal-panel-heading h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.portal-panel-heading p { margin: 2px 0 0; color: #5d6b7f; font-size: .78rem; }
.portal-panel-heading > div:last-child { display: grid; text-align: right; }
.portal-panel-heading > div:last-child strong { color: #356bff; font: 800 1.35rem "Manrope", sans-serif; }
.portal-panel-heading > div:last-child small { color: #5d6b7f; }
.portal-panel-heading button { padding: 0; border: 0; background: transparent; color: #356bff; cursor: pointer; font-size: .75rem; font-weight: 700; }
.portal-chart { display: grid; min-height: 178px; margin-top: 10px; place-items: center; color: #7b8899; }
.portal-chart svg { width: 100%; height: 178px; overflow: visible; }
.portal-chart-large { min-height: 480px; }
.portal-chart-large svg { height: 450px; }
.portal-overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.portal-data-panel { min-width: 0; padding: 21px; }
.portal-full-panel { min-height: 420px; }
.portal-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: .78rem; }
.portal-table th { padding: 10px 8px; border-bottom: 1px solid #dbe3ef; color: #5d6b7f; font-weight: 600; text-align: left; }
.portal-table td { padding: 12px 8px; border-bottom: 1px solid #edf1f7; vertical-align: top; }
.portal-table tr:last-child td { border-bottom: 0; }
.portal-empty { display: grid; min-height: 180px; place-items: center; color: #7b8899; font-size: .86rem; text-align: center; }
.portal-severity { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: #38d996; }
.portal-severity.warning { background: #f0a828; }
.portal-severity.critical { background: #ff705c; }
.portal-status { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #edf3ff; color: #2455dd; font-size: .68rem; font-weight: 700; }
.portal-status.paid, .portal-status.resolved { background: #def9ea; color: #16855f; }
.portal-status.overdue, .portal-status.urgent { background: #fff0ed; color: #c43d2d; }
.portal-download { padding: 0; border: 0; background: transparent; color: #356bff; cursor: pointer; font-weight: 700; }
.request-dialog { width: min(calc(100% - 30px), 610px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 35px 100px rgba(5,19,39,.32); }
.request-dialog::backdrop { background: rgba(8,24,46,.72); backdrop-filter: blur(5px); }
.request-dialog form { display: grid; gap: 18px; padding: 34px; }
.request-dialog form > div:first-child { display: flex; justify-content: space-between; }
.request-dialog h2 { margin: 0; font-size: 2rem; }
.request-dialog form > div button { width: 38px; height: 38px; border: 1px solid #dbe3ef; border-radius: 50%; background: #fff; cursor: pointer; font-size: 1.5rem; }
.request-dialog label { display: grid; gap: 7px; font-size: .85rem; font-weight: 700; }
.request-dialog select { padding-inline: 12px; }
.request-dialog textarea { min-height: 130px; padding: 12px; resize: vertical; }
.request-dialog > form > .button { width: 100%; border: 0; cursor: pointer; }
.request-dialog [data-request-feedback] { min-height: 1em; margin: 0; color: #c43d2d; font-size: .82rem; }

@media (max-width: 1100px) {
  .auth-layout { grid-template-columns: .8fr 1.2fr; }
  .auth-brand-panel { padding: 50px; }
  .portal-status-strip { grid-template-columns: repeat(2, 1fr); }
  .portal-status-strip article:nth-child(2) { border-right: 0; }
  .portal-status-strip article:nth-child(-n+2) { border-bottom: 1px solid #dbe3ef; }
  .portal-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; padding: 34px 24px; }
  .auth-brand img { width: 50px; height: 50px; }
  .auth-brand strong { font-size: 1.7rem; }
  .auth-brand small { display: none; }
  .auth-benefits { display: none; }
  .auth-form-panel { min-height: calc(100vh - 118px); padding: 45px 24px; }
  .auth-card h1 { font-size: 2.65rem; }
  .portal-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-workspace { margin-left: 0; }
  .portal-menu { display: grid; }
  .portal-main { padding: 26px 18px; }
  .portal-account > div, .portal-account button { display: none; }
  .portal-title-row { flex-direction: column; }
  .portal-title-row .button { width: 100%; }
}
@media (max-width: 540px) {
  .portal-topbar { padding-inline: 16px; }
  .portal-company strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-status-strip { grid-template-columns: 1fr; }
  .portal-status-strip article { border-right: 0; border-bottom: 1px solid #dbe3ef; }
  .portal-status-strip article:last-child { border-bottom: 0; }
  .portal-chart-panel, .portal-data-panel { margin-inline: -6px; padding: 18px 14px; }
  .portal-table { font-size: .72rem; }
  .portal-table th:nth-child(n+4), .portal-table td:nth-child(n+4) { display: none; }
  .request-dialog form { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { .portal-loading span { animation-duration: .01ms; animation-iteration-count: 1; } }
