:root {
  --portal-sidebar: 268px;
  --portal-topbar: 76px;
  --portal-bg: #f2f3f1;
  --portal-panel: #ffffff;
  --portal-green: #2b6554;
  --portal-amber: #936c23;
}

.portal-body { min-height: 100vh; background: var(--portal-bg); }
.portal-body [hidden] { display: none !important; }
.portal-body button { border-radius: 0; }
.portal-overline { margin: 0 0 12px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .92fr) minmax(520px, 1.08fr); background: var(--white); }
.login-brand-panel { min-height: 100vh; display: flex; flex-direction: column; padding: 42px clamp(38px, 5vw, 82px); color: var(--white); background: var(--ink); }
.login-brand-panel .brand { width: max-content; }
.brand-light .brand-logo { background: transparent; }
.login-brand-panel .brand-logo-light-wide { width: min(310px, 72vw); }
.login-brand-panel .brand-logo-light-wide { width: clamp(220px, 22vw, 300px); }
.login-message { margin: auto 0; max-width: 640px; padding: 70px 0; }
.login-message .portal-overline { color: #94b8ef; }
.login-message h1 { margin: 0 0 34px; font-size: clamp(3.2rem, 5.8vw, 6.7rem); font-weight: 500; line-height: .92; }
.login-message > p:last-child { max-width: 500px; margin: 0; color: #bfc7ce; font-size: 18px; }
.login-footnote { margin: 0; color: #7f8b96; font-size: 12px; }
.login-form-panel { position: relative; display: grid; place-items: center; padding: 96px 40px 48px; background: var(--paper); }
.back-link { position: absolute; top: 34px; right: 42px; border-bottom: 1px solid var(--line); padding-bottom: 3px; font-size: 13px; font-weight: 600; }
.login-card { width: min(100%, 470px); }
.demo-label { width: max-content; margin-bottom: 25px; padding: 7px 10px; color: var(--blue); background: #e8eef7; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.login-card h2 { margin: 0 0 13px; font-size: clamp(2.5rem, 4vw, 4.2rem); font-weight: 500; }
.login-card > p:not(.demo-label):not(.security-note) { margin-bottom: 38px; color: var(--muted); }
.login-card form { display: grid; }
.login-card label { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 56px; border: 1px solid var(--line); margin-bottom: 20px; padding: 0 16px; color: var(--ink); background: var(--white); outline: 0; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,75,143,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-field button { position: absolute; top: 0; right: 0; height: 56px; border: 0; padding: 0 17px; color: var(--blue); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.login-error { min-height: 23px; margin: -7px 0 10px; color: #a33f38; font-size: 13px; }
.login-submit { height: 56px; display: flex; align-items: center; justify-content: space-between; border: 0; padding: 0 19px; color: var(--white); background: var(--ink); cursor: pointer; font-weight: 700; transition: background .2s ease, transform .2s ease; }
.login-submit:hover { background: var(--blue); transform: translateY(-1px); }
.demo-credentials { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 24px; border: 1px solid var(--line); padding: 14px 16px; color: var(--muted); background: var(--white); font-size: 12px; }
.demo-credentials span { width: 100%; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.demo-credentials strong { color: var(--ink); font-weight: 600; }
.security-note { margin: 17px 0 0; color: #8a9198; font-size: 11px; line-height: 1.55; }

.portal-app { min-height: 100vh; }
.portal-topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--portal-topbar); display: grid; grid-template-columns: var(--portal-sidebar) 1fr auto; align-items: center; border-bottom: 1px solid var(--line); padding: 0 28px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.portal-topbar .brand { padding-right: 28px; }
.portal-topbar .portal-brand-logo, .admin-topbar .portal-brand-logo { width: 190px; }
.portal-topbar .portal-brand-logo, .admin-topbar .portal-brand-logo { width: 190px; }
.topbar-project { border-left: 1px solid var(--line); padding-left: 29px; line-height: 1.25; }
.topbar-project span, .topbar-project strong { display: block; }
.topbar-project span { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.topbar-project strong { font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.notice-button, .logout-button { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.notice-button { display: flex; align-items: center; gap: 8px; }
.notice-button span { display: grid; place-items: center; min-width: 26px; height: 22px; color: var(--white); background: var(--blue); font-size: 10px; }
.logout-button { border-left: 1px solid var(--line); padding-left: 17px; color: var(--muted); }

.portal-sidebar { position: fixed; z-index: 10; top: var(--portal-topbar); bottom: 0; left: 0; width: var(--portal-sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 32px 22px 22px; background: var(--ink); color: var(--white); overflow-y: auto; }
.client-card { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #33404b; padding: 0 8px 28px; }
.client-avatar { width: 39px; height: 39px; display: grid; place-items: center; background: var(--blue); font-size: 11px; font-weight: 700; }
.client-card small, .client-card strong { display: block; }
.client-card small { color: #8895a0; font-size: 10px; }
.client-card strong { font-size: 13px; }
.portal-nav { display: grid; gap: 2px; margin-top: 28px; }
.portal-nav button { position: relative; width: 100%; display: grid; grid-template-columns: 27px 1fr auto; gap: 8px; align-items: center; border: 0; padding: 13px 12px; color: #adb6be; background: transparent; cursor: pointer; text-align: left; font-size: 13px; transition: color .2s ease, background .2s ease; }
.portal-nav button > span { color: #687682; font-size: 9px; }
.portal-nav button i { min-width: 19px; height: 19px; display: grid; place-items: center; color: var(--ink); background: #9ebcf0; font-size: 9px; font-style: normal; }
.portal-nav button:hover { color: var(--white); background: #1a2733; }
.portal-nav button.is-active { color: var(--white); background: var(--blue); }
.portal-nav button.is-active > span { color: #bdd0ee; }
.manager-card { margin-top: auto; border-top: 1px solid #33404b; padding: 22px 8px 2px; }
.manager-card small, .manager-card strong { display: block; }
.manager-card small { margin-bottom: 4px; color: #85919c; font-size: 10px; }
.manager-card strong { margin-bottom: 10px; font-size: 13px; }
.manager-card a { color: #a9c5ef; font-size: 11px; font-weight: 600; }

.portal-content { min-height: 100vh; margin-left: var(--portal-sidebar); padding: calc(var(--portal-topbar) + 46px) clamp(32px, 4vw, 68px) 70px; }
.portal-view { max-width: 1280px; margin-inline: auto; animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); margin-bottom: 32px; padding-bottom: 27px; }
.view-heading h1 { margin: 0; font-size: clamp(2.35rem, 4vw, 4.4rem); font-weight: 500; }
.view-heading > p { flex: 0 0 auto; margin: 0 0 5px; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: right; }
.view-heading > p strong { color: var(--ink); font-weight: 600; }
.card-kicker { margin: 0 0 9px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.status-grid { display: grid; grid-template-columns: 2fr repeat(2, 1fr); gap: 1px; margin-bottom: 25px; background: var(--line); border: 1px solid var(--line); }
.progress-card { grid-row: span 2; display: grid; grid-template-columns: 142px 1fr; gap: 27px; align-items: center; padding: 34px; background: var(--portal-panel); }
.progress-ring { --angle: calc(var(--progress) * 3.6deg); width: 136px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue) var(--angle), #e3e6e8 0); }
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 108px; aspect-ratio: 1; border-radius: 50%; background: var(--white); }
.progress-ring span { z-index: 1; grid-area: 1 / 1; font-size: 34px; font-weight: 500; letter-spacing: -.06em; }
.progress-ring small { margin-left: 2px; color: var(--muted); font-size: 13px; }
.progress-card h2 { margin: 0 0 11px; font-size: 26px; font-weight: 500; }
.progress-card div > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.metric-card { min-height: 137px; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: var(--portal-panel); }
.metric-card span, .metric-card small { color: var(--muted); font-size: 10px; }
.metric-card span { margin-bottom: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric-card strong { margin-bottom: 3px; font-size: 20px; font-weight: 600; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; }
.panel { border: 1px solid var(--line); padding: 28px; background: var(--portal-panel); }
.next-actions { grid-row: span 2; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 23px; padding-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 22px; font-weight: 500; }
.panel-heading button, .text-action { border: 0; padding: 3px 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.next-actions ol { list-style: none; margin: 0; padding: 0; }
.next-actions li { position: relative; min-height: 66px; display: grid; grid-template-columns: 23px 1fr; gap: 15px; }
.next-actions li:not(:last-child)::before { content: ""; position: absolute; top: 16px; bottom: -5px; left: 7px; width: 1px; background: var(--line); }
.next-actions li > span { z-index: 1; width: 15px; height: 15px; margin-top: 2px; border: 2px solid #b8bec3; border-radius: 50%; background: var(--white); }
.next-actions li.is-done > span { border-color: var(--portal-green); background: var(--portal-green); }
.next-actions li.is-current > span { border: 4px solid #a9c1e4; background: var(--blue); }
.next-actions li strong, .next-actions li small { display: block; }
.next-actions li strong { margin-bottom: 2px; font-size: 13px; }
.next-actions li small { color: var(--muted); font-size: 10px; }
.mini-decision { border-bottom: 1px solid var(--line); padding: 1px 0 17px; margin-bottom: 17px; }
.mini-decision:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.mini-decision span, .mini-decision strong, .mini-decision small { display: block; }
.mini-decision span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mini-decision strong { margin: 4px 0; font-size: 13px; }
.mini-decision small { color: var(--muted); font-size: 10px; }
.payment-summary > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.status-pill { width: max-content; display: inline-block; padding: 5px 8px; color: var(--muted); background: #edf0f1; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.status-pill.is-review { color: #775616; background: #f4ead2; }
.status-pill.is-paid, .status-pill.is-done { color: #275b4c; background: #dcece5; }
.status-pill.is-progress { color: #204d88; background: #dfe9f7; }

.demo-context { margin: -14px 0 34px; color: var(--muted); font-size: 11px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 40px; left: 44px; width: 1px; background: var(--line); }
.timeline-entry { position: relative; display: grid; grid-template-columns: 90px 1fr; gap: 34px; margin-bottom: 48px; }
.timeline-date { z-index: 1; width: 88px; height: 88px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--white); }
.timeline-date strong { font-size: 27px; font-weight: 500; }
.timeline-date span { color: var(--muted); font-size: 8px; line-height: 1.35; }
.timeline-content { border: 1px solid var(--line); padding: 32px; background: var(--white); }
.timeline-content h2 { margin: 15px 0 10px; font-size: 28px; font-weight: 500; }
.timeline-content > p { max-width: 760px; margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.progress-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.progress-gallery.single { grid-template-columns: 1fr; }
.progress-gallery figure { height: 300px; margin: 0; overflow: hidden; background: #e1e4e5; }
.progress-gallery.single figure { height: 390px; }
.progress-gallery img { width: 100%; height: 100%; object-fit: cover; }
.entry-note { margin-top: 10px; padding: 18px 20px; background: #f1f3f4; }
.entry-note strong { font-size: 11px; }
.entry-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.drive-banner { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 20px; padding: 22px 25px; color: var(--white); background: var(--ink); }
.drive-banner > div { display: flex; align-items: center; gap: 17px; }
.drive-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--blue); font-weight: 700; }
.drive-banner strong, .drive-banner p { display: block; }
.drive-banner strong { font-size: 13px; }
.drive-banner p { margin: 3px 0 0; color: #aeb7bf; font-size: 11px; }
.drive-banner > span { color: #93a0aa; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.file-card { min-height: 225px; display: grid; grid-template-columns: 45px 1fr; grid-template-rows: 1fr auto; gap: 18px; padding: 28px; background: var(--white); }
.file-card:last-child { grid-column: 1 / -1; }
.file-number { color: var(--blue); font-size: 11px; font-weight: 700; }
.file-card p { margin: 0 0 7px; color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.file-card h2 { max-width: 380px; margin: 0 0 11px; font-size: 21px; font-weight: 500; }
.file-card small { color: var(--muted); font-size: 10px; }
.file-card button { grid-column: 2; width: max-content; border: 0; border-bottom: 1px solid currentColor; padding: 0 0 3px; color: var(--ink); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.file-card button:hover { color: var(--blue); }

.certification-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 22px; border: 1px solid var(--line); background: var(--line); }
.certification-summary div { padding: 24px; background: var(--ink); }
.certification-summary span, .certification-summary strong { display: block; }
.certification-summary span { margin-bottom: 5px; color: #95a0aa; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.certification-summary strong { color: var(--white); font-size: 24px; font-weight: 500; }
.certification-list { border: 1px solid var(--line); background: var(--white); }
.certification-list article { display: grid; grid-template-columns: 80px minmax(250px, 1fr) 130px 90px 110px; gap: 22px; align-items: center; min-height: 128px; border-bottom: 1px solid var(--line); padding: 21px 25px; }
.certification-list article:last-child { border-bottom: 0; }
.certification-list article.is-muted { color: #8a9299; background: #f7f8f7; }
.cert-id { border-right: 1px solid var(--line); }
.cert-id small, .cert-id strong { display: block; }
.cert-id small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.cert-id strong { font-size: 27px; font-weight: 500; }
.certification-list h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.certification-list p { margin: 0; color: var(--muted); font-size: 10px; }
.cert-amount { font-size: 14px; font-weight: 600; }
.certification-list button { border: 0; border-bottom: 1px solid currentColor; padding: 0 0 3px; background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.certification-list button:disabled { border: 0; color: #a4aaaf; cursor: default; }

.decision-intro { max-width: 700px; margin-bottom: 31px; color: var(--muted); font-size: 14px; }
.decision-list { display: grid; gap: 12px; }
.decision-card { display: grid; grid-template-columns: 55px 1fr auto; gap: 25px; align-items: center; border: 1px solid var(--line); border-left: 3px solid var(--blue); padding: 26px 28px; background: var(--white); transition: opacity .25s ease, background .25s ease; }
.decision-order { color: var(--blue); font-size: 11px; font-weight: 700; }
.decision-info span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.decision-info h2 { margin: 6px 0 7px; font-size: 20px; font-weight: 600; }
.decision-info p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.decision-info small { color: #8c6a28; font-size: 10px; }
.decision-actions { min-width: 165px; display: grid; gap: 9px; }
.decision-actions button { min-height: 39px; border: 1px solid var(--line); padding: 8px 13px; background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.decision-actions .decision-approve { border-color: var(--ink); color: var(--white); background: var(--ink); }
.decision-actions .decision-approve:hover { border-color: var(--blue); background: var(--blue); }
.decision-card.is-approved { border-left-color: var(--portal-green); opacity: .65; }
.decision-card.is-approved .decision-info small { color: var(--portal-green); }
.approved-mark { color: var(--portal-green); font-size: 11px; font-weight: 700; }

.warranty-hero { display: grid; grid-template-columns: 1.5fr .7fr; gap: 1px; margin-bottom: 22px; border: 1px solid var(--line); background: var(--line); }
.warranty-hero > div { padding: 40px; background: var(--white); }
.warranty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 40px; color: var(--white); background: var(--ink); font-size: 20px; }
.warranty-hero h2 { max-width: 650px; margin: 0 0 17px; font-size: clamp(2rem, 3.5vw, 3.8rem); font-weight: 500; }
.warranty-hero p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; }
.warranty-status { display: flex; flex-direction: column; justify-content: end; }
.warranty-status span, .warranty-status strong, .warranty-status small { display: block; }
.warranty-status span { margin-bottom: 9px; color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.warranty-status strong { margin-bottom: 6px; font-size: 18px; }
.warranty-status small { color: var(--muted); font-size: 10px; }
.warranty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.warranty-grid article { min-height: 210px; padding: 25px; background: var(--white); }
.warranty-grid span { color: var(--blue); font-size: 10px; font-weight: 700; }
.warranty-grid h3 { margin: 48px 0 10px; font-size: 16px; font-weight: 600; }
.warranty-grid p { margin: 0; color: var(--muted); font-size: 11px; }

.portal-toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 390px; border-left: 3px solid #88ace1; padding: 16px 18px; color: var(--white); background: var(--ink); box-shadow: 0 18px 50px rgba(16,25,35,.2); font-size: 12px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.portal-toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  :root { --portal-sidebar: 230px; }
  .portal-topbar { grid-template-columns: var(--portal-sidebar) 1fr auto; padding-inline: 20px; }
  .notice-button { font-size: 0; }
  .notice-button span { font-size: 10px; }
  .status-grid { grid-template-columns: 1.5fr 1fr; }
  .progress-card { grid-row: span 2; }
  .certification-list article { grid-template-columns: 65px minmax(220px, 1fr) 115px 85px; }
  .certification-list article button { grid-column: 2; width: max-content; }
  .warranty-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --portal-topbar: 62px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 300px; padding: 24px 22px; }
  .login-message { padding: 48px 0 22px; }
  .login-message h1 { margin-bottom: 22px; font-size: clamp(2.65rem, 11vw, 4.2rem); }
  .login-message > p:last-child { font-size: 15px; }
  .login-footnote { display: none; }
  .login-form-panel { min-height: 540px; padding: 82px 20px 45px; }
  .back-link { top: 26px; right: 20px; }
  .portal-topbar { grid-template-columns: 1fr auto; }
  .topbar-project { display: none; }
  .portal-sidebar { position: fixed; top: var(--portal-topbar); right: 0; bottom: auto; width: 100%; height: 86px; display: block; border: 0; border-bottom: 1px solid #34414c; padding: 0; overflow: hidden; }
  .client-card, .manager-card { display: none; }
  .portal-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; background: #263441; overflow: hidden; }
  .portal-nav button { min-width: 0; height: 42px; display: flex; justify-content: center; gap: 5px; padding: 0 7px; font-size: 10px; text-align: center; white-space: nowrap; }
  .portal-nav button > span { display: none; }
  .portal-nav button i { min-width: 16px; height: 16px; font-size: 8px; }
  .portal-content { margin-left: 0; padding: calc(var(--portal-topbar) + 112px) 18px 45px; }
  .view-heading { align-items: start; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .progress-card { grid-column: 1 / -1; grid-row: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: 1fr; }
  .file-card:last-child { grid-column: auto; }
  .certification-list article { grid-template-columns: 55px 1fr auto; }
  .cert-amount { grid-column: 2; }
  .certification-list article .status-pill { grid-column: 3; grid-row: 1; }
  .certification-list article button { grid-column: 3; grid-row: 2; }
  .decision-card { grid-template-columns: 45px 1fr; }
  .decision-actions { grid-column: 2; grid-template-columns: auto auto; }
  .warranty-hero { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .portal-topbar { padding-inline: 15px; }
  .portal-topbar .portal-brand-logo, .admin-topbar .portal-brand-logo { width: 155px; }
  .portal-topbar .portal-brand-logo, .admin-topbar .portal-brand-logo { width: 155px; }
  .portal-topbar .brand-name { display: none; }
  .topbar-actions { gap: 10px; }
  .logout-button { padding-left: 10px; }
  .portal-content { padding-inline: 13px; }
  .view-heading { display: block; }
  .view-heading { margin-bottom: 24px; padding-bottom: 20px; }
  .view-heading h1 { font-size: 2.05rem; }
  .view-heading > p { margin-top: 15px; text-align: left; }
  .status-grid { grid-template-columns: 1fr; }
  .progress-card { grid-template-columns: 96px 1fr; gap: 18px; padding: 20px; }
  .progress-ring { width: 92px; }
  .progress-ring::before { width: 72px; }
  .progress-ring span { font-size: 27px; }
  .progress-card h2 { font-size: 20px; }
  .progress-card div > p:last-child { font-size: 11px; }
  .metric-card { min-height: 96px; padding: 19px; }
  .panel { padding: 19px; }
  .timeline::before { left: 28px; }
  .timeline-entry { grid-template-columns: 57px 1fr; gap: 12px; }
  .timeline-date { width: 56px; height: 64px; display: grid; gap: 0; text-align: center; }
  .timeline-date strong { font-size: 20px; }
  .timeline-date span { font-size: 7px; }
  .timeline-content { padding: 17px; }
  .timeline-content h2 { font-size: 19px; }
  .progress-gallery { grid-template-columns: 1fr; }
  .progress-gallery figure, .progress-gallery.single figure { height: 190px; }
  .drive-banner { align-items: start; }
  .drive-banner > span { display: none; }
  .file-card { grid-template-columns: 33px 1fr; padding: 23px; }
  .certification-summary { grid-template-columns: 1fr; }
  .certification-list article { grid-template-columns: 45px 1fr; gap: 15px; padding: 20px; }
  .certification-list article .status-pill, .certification-list article button { grid-column: 2; grid-row: auto; width: max-content; }
  .decision-card { grid-template-columns: 1fr; padding: 23px; }
  .decision-order, .decision-actions { grid-column: 1; }
  .decision-actions { grid-template-columns: 1fr; }
  .warranty-hero > div { padding: 28px; }
  .warranty-grid { grid-template-columns: 1fr; }
  .warranty-grid article { min-height: 175px; }
  .warranty-grid h3 { margin-top: 30px; }
  .portal-toast { right: 15px; bottom: 15px; left: 15px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-view { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Portal conectado y administración */
.access-label { width: max-content; margin: 0 0 25px; padding: 7px 10px; color: var(--blue); background: #e8eef7; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.access-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 26px; padding: 1px; background: var(--line); }
.access-switch button { min-height: 44px; border: 0; color: var(--muted); background: var(--white); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; transition: color .2s ease, background .2s ease; }
.access-switch button:hover { color: var(--blue); }
.access-switch button.is-active { color: var(--white); background: var(--ink); }
.login-submit:disabled, .admin-primary:disabled { cursor: wait; opacity: .72; transform: none; }
.button-loader { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: buttonSpin .7s linear infinite; }
@keyframes buttonSpin { to { transform: rotate(360deg); } }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); background: var(--paper); }
.loading-mark { width: 58px; height: 58px; display: grid; place-items: center; padding: 8px; background: var(--white); animation: loadingPulse 1.25s ease-in-out infinite alternate; }
.loading-mark img { display: block; width: 100%; height: auto; }
.loading-screen p { margin: 0; font-size: 13px; }
@keyframes loadingPulse { to { background: var(--blue); transform: translateY(-3px); } }
.project-selector { max-width: 250px; height: 38px; border: 1px solid var(--line); padding: 0 34px 0 12px; color: var(--ink); background: var(--white); font: inherit; font-size: 11px; }
.progress-ring b { font: inherit; }
.empty-state, .content-empty { border: 1px solid var(--line); padding: clamp(30px, 6vw, 72px); background: var(--white); }
.empty-state span, .content-empty span { color: var(--blue); font-size: 11px; font-weight: 700; }
.empty-state h2, .content-empty h2 { max-width: 680px; margin: 38px 0 12px; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 500; }
.empty-state p, .content-empty p { max-width: 610px; margin: 0; color: var(--muted); font-size: 13px; }
.content-empty { width: 100%; grid-column: 1 / -1; }
.content-empty h2 { margin-top: 23px; font-size: 22px; }
.content-empty p { font-size: 12px; }
.external-action, .file-card a, .certification-list a, .decision-detail { width: max-content; display: inline-block; border-bottom: 1px solid currentColor; padding-bottom: 3px; color: var(--ink); font-size: 11px; font-weight: 700; }
.external-action:hover, .file-card a:hover, .certification-list a:hover, .decision-detail:hover { color: var(--blue); }
.file-card a { grid-column: 2; }
.certification-list a { font-size: 10px; }
.decision-detail { min-height: 39px; display: grid; place-items: center; border: 1px solid var(--line); padding: 8px 13px; text-align: center; }
.portal-toast[data-tone="success"] { border-left-color: var(--portal-green); }
.portal-toast[data-tone="error"] { border-left-color: #c7534d; }

.admin-app { min-height: 100vh; background: var(--portal-bg); }
.admin-topbar { position: fixed; z-index: 30; inset: 0 0 auto 0; height: 76px; display: grid; grid-template-columns: 268px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); padding: 0 28px; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.admin-topbar > div { border-left: 1px solid var(--line); padding-left: 29px; }
.admin-topbar > div span, .admin-topbar > div strong { display: block; }
.admin-topbar > div span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.admin-topbar > div strong { margin-top: 3px; font-size: 13px; }
.admin-sidebar { position: fixed; z-index: 20; top: 76px; bottom: 0; left: 0; width: 268px; display: flex; flex-direction: column; padding: 38px 28px 25px; color: var(--white); background: var(--ink); }
.admin-sidebar .portal-overline { color: #94b8ef; }
.admin-nav { display: grid; gap: 2px; margin-top: 20px; }
.admin-nav button { width: 100%; min-height: 48px; border: 0; padding: 0 14px; color: #adb6be; background: transparent; cursor: pointer; text-align: left; font: inherit; font-size: 13px; transition: color .2s ease, background .2s ease; }
.admin-nav button:hover { color: var(--white); background: #1a2733; }
.admin-nav button.is-active { color: var(--white); background: var(--blue); }
.admin-help { margin: auto 0 0; border-top: 1px solid #34414c; padding-top: 22px; color: #87939d; font-size: 10px; line-height: 1.6; }
.admin-content { min-height: 100vh; margin-left: 268px; padding: 122px clamp(32px, 4vw, 68px) 72px; }
.admin-view { max-width: 1280px; margin-inline: auto; animation: viewIn .35s ease both; }
.admin-primary { min-height: 48px; display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; border: 0; padding: 0 18px; color: var(--white); background: var(--ink); cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; transition: background .2s ease, transform .2s ease; }
.admin-primary:hover { background: var(--blue); transform: translateY(-1px); }
.admin-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); margin-bottom: 22px; background: var(--line); }
.admin-metrics article { min-height: 130px; display: flex; flex-direction: column; justify-content: center; padding: 25px; background: var(--ink); }
.admin-metrics span { color: #95a0aa; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.admin-metrics strong { margin-top: 7px; color: var(--white); font-size: 31px; font-weight: 500; }
.admin-table-wrap { border: 1px solid var(--line); overflow-x: auto; background: var(--white); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.admin-table th { height: 48px; border-bottom: 1px solid var(--line); padding: 0 18px; color: var(--muted); background: #f5f6f5; font-size: 9px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.admin-table td { height: 78px; border-bottom: 1px solid var(--line); padding: 13px 18px; color: var(--muted); font-size: 11px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td strong { display: block; color: var(--ink); font-size: 12px; }
.admin-table td small { display: block; margin-top: 3px; color: var(--muted); }
.admin-table td button { border: 0; border-bottom: 1px solid currentColor; padding: 0 0 3px; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; }
.table-empty { height: 150px !important; text-align: center; }
.admin-form { max-width: 950px; border: 1px solid var(--line); padding: clamp(25px, 4vw, 48px); background: var(--white); }
.form-intro { display: grid; grid-template-columns: 46px 1fr; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 33px; padding-bottom: 28px; }
.form-intro > span { color: var(--blue); font-size: 11px; font-weight: 700; }
.form-intro h2 { margin: 0 0 7px; font-size: 25px; font-weight: 500; }
.form-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.admin-form label { display: grid; gap: 8px; color: var(--ink); font-size: 11px; font-weight: 700; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 0 14px; color: var(--ink); background: var(--white); outline: 0; font: inherit; font-size: 13px; }
.admin-form input, .admin-form select { height: 52px; }
.admin-form textarea { resize: vertical; padding-block: 13px; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,75,143,.1); }
.form-wide { grid-column: 1 / -1; }
.form-feedback { min-height: 47px; margin-top: 20px; padding: 13px 15px; color: var(--muted); background: #f5f6f5; font-size: 11px; }
.form-feedback:empty { min-height: 0; margin-top: 0; padding: 0; }
.form-feedback[data-tone="success"] { color: #275b4c; background: #dcece5; }
.form-feedback[data-tone="error"] { color: #8c342f; background: #f4dfdd; }
.admin-form > .admin-primary, #projectEditFields > .admin-primary { margin-top: 21px; }
.form-project-picker { max-width: 620px; margin-bottom: 30px; }
.content-manager { max-width: 1050px; }
.content-manager > .form-project-picker { display: grid; gap: 9px; border: 1px solid var(--line); margin: 0 0 18px; padding: 22px 24px; background: var(--white); font-size: 11px; font-weight: 700; }
.content-manager > .form-project-picker select { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 0; padding: 0 14px; color: var(--ink); background: var(--white); font: inherit; font-size: 13px; }
.content-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin-bottom: 18px; padding: 1px; background: var(--line); overflow-x: auto; }
.content-tabs button { min-width: 145px; min-height: 50px; border: 0; padding: 0 14px; color: var(--muted); background: var(--white); cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; transition: color .2s ease, background .2s ease; }
.content-tabs button:hover { color: var(--blue); }
.content-tabs button.is-active { color: var(--white); background: var(--blue); }
.content-form { max-width: none; }
.managed-content { border: 1px solid var(--line); margin-top: 18px; background: var(--white); }
.managed-content-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 23px 25px; }
.managed-content-heading .portal-overline { margin: 0; }
.managed-content-heading strong { font-size: 17px; font-weight: 600; }
.managed-item { min-height: 96px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); padding: 19px 25px; }
.managed-item:last-child { border-bottom: 0; }
.managed-item span { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.managed-item h3 { margin: 5px 0 3px; font-size: 14px; font-weight: 600; }
.managed-item p { margin: 0; color: var(--muted); font-size: 10px; }
.managed-item button { border: 0; border-bottom: 1px solid currentColor; padding: 0 0 3px; color: #9b4944; background: transparent; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; }
.managed-item button:hover { color: #c2352d; }
.managed-item button:disabled { opacity: .45; cursor: wait; }
.managed-content .content-empty { border: 0; padding: 36px 25px; }
.manager-loading { padding: 35px 25px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .admin-topbar { grid-template-columns: 1fr auto; }
  .admin-topbar > div { display: none; }
  .admin-sidebar { position: fixed; top: 76px; right: 0; bottom: auto; width: 100%; height: 92px; display: block; padding: 0; overflow: hidden; }
  .admin-sidebar > .portal-overline, .admin-help { display: none; }
  .admin-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; width: 100%; margin: 0; background: #263441; }
  .admin-nav button { width: auto; min-width: 0; height: 45px; padding-inline: 8px; font-size: 10px; text-align: center; }
  .admin-content { margin-left: 0; padding: 192px 18px 50px; }
  .admin-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .access-switch { grid-template-columns: 1fr; }
  .project-selector { max-width: 150px; }
  .admin-topbar { padding-inline: 15px; }
  .admin-topbar .brand-name { display: none; }
  .admin-content { padding-inline: 13px; }
  .admin-content .view-heading .admin-primary { width: 100%; margin-top: 20px; }
  .admin-metrics { grid-template-columns: 1fr; }
  .admin-metrics article { min-height: 92px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-wide { grid-column: auto; }
  .admin-form { padding: 23px; }
  .form-intro { grid-template-columns: 32px 1fr; }
  .content-tabs { grid-template-columns: repeat(2, 1fr); overflow: hidden; }
  .content-tabs button { min-width: 0; min-height: 44px; padding: 0 8px; font-size: 10px; }
  .managed-content-heading { align-items: start; flex-direction: column; }
  .managed-item { grid-template-columns: 1fr; gap: 14px; }
  .managed-item button { width: max-content; }
}
