.auth-view {
    width: min(1040px, calc(100% - 40px));
    min-height: 650px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: minmax(420px, .9fr) 1.1fr;
    overflow: hidden;
    border: 1px solid rgba(7, 26, 51, .12);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.auth-card {
    padding: clamp(42px, 7vw, 78px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-brand, .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-brand);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .12em;
}

.auth-brand { margin-bottom: 55px; color: var(--ink); }
.auth-brand b, .brand b { font-weight: 400; }
.brand-mark { display: grid; place-items: center; }
.brand-mark svg { width: 25px; height: 25px; }

.eyebrow {
    margin: 0 0 7px;
    color: var(--blue);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin: 0;
    max-width: 520px;
    font-family: var(--font-display);
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 650;
    letter-spacing: -.045em;
    line-height: .98;
}

.auth-copy {
    max-width: 470px;
    margin: 24px 0 30px;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.65;
}

.auth-form, .stack-form { display: grid; gap: 9px; }
.auth-form { max-width: 420px; }

label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

label span { color: var(--muted); font-weight: 400; }

input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: #fff;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #98a6b9; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(8, 101, 245, .1);
}

.otp-input {
    height: 58px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 25px;
    letter-spacing: .45em;
}

.field-hint { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; }

.button {
    min-height: 42px;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: transform .16s, box-shadow .16s, border-color .16s, background .16s;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button svg { width: 17px; height: 17px; }
.button-block { width: 100%; margin-top: 8px; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(8, 101, 245, .2); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { color: var(--blue); border-color: var(--blue); background: #fff; }
.button-secondary:hover:not(:disabled) { background: var(--blue-soft); }
.button-quiet { min-height: 34px; color: var(--blue); border-color: var(--blue); background: #fff; }
.button-accent { min-width: 260px; color: #fff; background: linear-gradient(90deg, var(--orange-dark), var(--orange)); box-shadow: 0 10px 20px rgba(255, 106, 0, .2); }
.text-button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }

.trust-line {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}
.trust-line svg { width: 16px; height: 16px; color: var(--green); }

.auth-aside {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(140deg, rgba(8, 101, 245, .18), transparent 45%),
        linear-gradient(155deg, var(--navy-2), var(--navy));
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .14;
    background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.security-orbit { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.orbit-one { width: 420px; height: 420px; }
.orbit-two { width: 580px; height: 580px; }
.security-seal { position: relative; z-index: 1; display: grid; justify-items: center; gap: 12px; text-align: center; }
.security-seal::before { content: ""; position: absolute; inset: -42px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(8,101,245,.24), transparent 68%); }
.security-seal svg { width: 88px; height: 88px; color: #71a9ff; filter: drop-shadow(0 10px 28px rgba(8,101,245,.4)); }
.security-seal strong { font-family: var(--font-display); font-size: 25px; letter-spacing: -.02em; }
.security-seal span { color: #aebfd3; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.portal {
    width: min(1080px, calc(100% - 40px));
    min-height: 0;
    margin: 20px auto;
    overflow: hidden;
    border: 2px solid var(--navy);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: portal-in .45s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes portal-in { from { opacity: 0; transform: translateY(12px) scale(.992); } }

.topbar {
    height: var(--topbar-height);
    padding: 0 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    color: #fff;
    background: linear-gradient(90deg, var(--navy), #051a31 58%, var(--navy));
}

.brand { width: max-content; }
.topbar-title { font-family: var(--font-display); font-size: 15px; letter-spacing: .01em; }
.account-menu { justify-self: end; display: flex; align-items: center; gap: 12px; color: #c7d3e2; font-size: 12px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 7px; color: inherit; background: transparent; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.icon-button svg { width: 19px; height: 19px; }

.portal-grid { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - 102px); }
.sidebar { position: relative; padding: 42px 0 20px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #fbfdff, #f5f8fc); }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { position: relative; height: 54px; padding: 0 23px; display: flex; align-items: center; gap: 15px; border: 0; color: #38506d; background: transparent; text-align: left; }
.nav-item::after { content: ""; position: absolute; top: 8px; right: 0; bottom: 8px; width: 3px; border-radius: 3px 0 0 3px; background: transparent; }
.nav-item:hover, .nav-item.is-active { color: var(--blue); background: linear-gradient(90deg, var(--blue-soft), transparent); }
.nav-item.is-active::after { background: var(--blue); }
.nav-item svg { width: 21px; height: 21px; }
.sidebar-note { position: absolute; bottom: 24px; left: 20px; right: 20px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: rgba(255,255,255,.75); font-size: 11px; line-height: 1.4; }
.sidebar-note svg { color: var(--blue); }

.workspace { min-width: 0; background: #fbfcfe; }
.contextbar { min-height: 48px; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--blue); font-size: 12px; font-weight: 700; }
.breadcrumbs svg { width: 14px; height: 14px; color: var(--muted); }
.breadcrumbs select { width: min(400px, 42vw); min-height: 32px; padding: 5px 9px; border-color: transparent; background: transparent; font-weight: 600; }
.request-meta { display: flex; align-items: center; gap: 25px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 355px; background: var(--surface-soft); }
.delivery-column { min-width: 0; padding: 12px; display: grid; gap: 12px; }
.rail { padding: 12px 12px 12px 0; display: grid; align-content: start; gap: 12px; }
.dashboard [data-view] { display: none; }
.dashboard[data-active-view="resumen"] [data-view="resumen"],
.dashboard[data-active-view="credenciales"] [data-view="credenciales"],
.dashboard[data-active-view="imagenes"] [data-view="imagenes"],
.dashboard[data-active-view="archivos"] [data-view="archivos"],
.dashboard[data-active-view="comentarios"] [data-view="comentarios"],
.dashboard[data-active-view="actividad"] [data-view="actividad"] { display: block; }
.dashboard .submission-grid { display: contents; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.96); box-shadow: 0 1px 2px rgba(7,26,51,.025); }

.progress-panel { padding: 20px 24px; }
.progress-track { display: grid; grid-template-columns: repeat(4, 1fr); }
.progress-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 11px; }
.progress-step:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: calc(50% + 36px); right: 18px; height: 1px; background: var(--line); }
.progress-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-soft); background: #e7edf5; font-family: var(--font-display); font-weight: 700; }
.progress-step.is-active .progress-number, .progress-step.is-done .progress-number { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(8,101,245,.24); }
.progress-step.is-done:not(:last-child)::after { background: var(--blue); }
.progress-copy strong { display: block; font-size: 12px; }
.progress-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.progress-step.is-active .progress-copy strong { color: var(--blue); }

.requirements-panel { padding: 17px 20px 0; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.section-heading.compact { margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 650; }
.section-heading > svg { color: var(--blue); }
.count-pill { min-width: 25px; padding: 4px 8px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 700; text-align: center; }
.requirements-list { margin: 0 -20px; border-top: 1px solid var(--line); }
.requirement { min-height: 58px; padding: 10px 18px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 18px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.requirement { width: 100%; border-top: 0; border-right: 0; border-left: 0; color: var(--ink); background: #fff; text-align: left; }
.requirement:hover { background: #f7faff; }
.requirement:last-child { border-bottom: 0; }
.requirement-number { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #8bb7ff; border-radius: 50%; color: var(--blue); font-size: 11px; }
.requirement strong, .requirement small { display: block; }
.requirement strong { font-size: 12px; }
.requirement small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.requirement > svg { width: 15px; height: 15px; color: var(--ink-soft); }

.status { display: inline-flex; align-items: center; width: max-content; padding: 4px 9px; border: 1px solid; border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.status-pending { color: var(--amber); border-color: #f5b65e; background: var(--amber-soft); }
.status-progress { color: var(--blue); border-color: #86b5ff; background: var(--blue-soft); }
.status-success { color: var(--green); border-color: #91d5b4; background: var(--green-soft); }
.status-danger { color: var(--red); border-color: #f3a1ab; background: var(--red-soft); }
.status-neutral { color: var(--ink-soft); border-color: var(--line-strong); background: var(--surface-soft); }

.submission-grid { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(400px, 1.28fr); gap: 12px; }
.credential-panel, .files-panel { padding: 18px; }
.stack-form { gap: 7px; }
.stack-form input, .stack-form select, .stack-form textarea { min-height: 38px; padding: 8px 10px; font-size: 12px; }
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-field button { position: absolute; top: 0; right: 0; width: 40px; height: 100%; display: grid; place-items: center; border: 0; color: var(--muted); background: transparent; }
.password-field svg { width: 17px; height: 17px; }
.credential-list { display: grid; gap: 7px; margin-top: 13px; }
.credential-row, .file-row { padding: 9px 10px; display: grid; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.credential-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.credential-row strong, .file-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.credential-row small, .file-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.mini-button { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; }
.mini-button:hover { color: var(--blue); border-color: var(--blue); }
.mini-button.is-danger:hover { color: var(--red); border-color: var(--red); }
.mini-button svg { width: 14px; height: 14px; }

.drop-zone { min-height: 160px; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1.5px dashed var(--blue); border-radius: 8px; color: var(--ink); background: linear-gradient(180deg, #fff, #f7faff); text-align: center; transition: background .2s, transform .2s;
}
.file-target { margin-bottom: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.file-target select { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.drop-zone.is-dragging { transform: scale(.992); background: var(--blue-soft); }
.drop-zone.is-disabled { cursor: not-allowed; opacity: .55; }
.drop-zone > svg { width: 29px; height: 29px; margin-bottom: 3px; color: var(--blue); }
.drop-zone strong { font-size: 12px; }
.drop-zone > span:not(.button) { color: var(--muted); font-size: 10px; }
.drop-zone .button { margin-top: 4px; font-size: 11px; }
.upload-status { min-height: 0; margin-top: 8px; color: var(--blue); font-size: 11px; }
.files-list { display: grid; gap: 7px; margin-top: 9px; }
.file-row { grid-template-columns: 28px minmax(0, 1fr) auto auto auto; }
.file-icon { width: 28px; height: 32px; display: grid; place-items: center; border-radius: 5px; color: var(--blue); background: var(--blue-soft); }
.file-icon svg { width: 16px; height: 16px; }

.summary-card, .activity-card, .comments-card { padding: 18px; }
.summary-card h2 { margin: 12px 0 15px; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 15px; }
.summary-card h2::before { content: ""; width: 8px; height: 26px; border-radius: 3px; background: var(--blue); }
.summary-card dl { margin: 0; }
.summary-card dl > div { padding: 15px 0; border-top: 1px solid var(--line); }
.summary-card dt { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.summary-card dt svg { width: 18px; height: 18px; color: var(--blue); }
.summary-card dd { margin: 6px 0 0 27px; font-size: 12px; font-weight: 700; }

.timeline { display: grid; }
.timeline-item { position: relative; padding: 0 0 18px 30px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 18px; bottom: 0; left: 9px; width: 1px; background: var(--line-strong); }
.timeline-dot { position: absolute; top: 1px; left: 1px; width: 17px; height: 17px; display: grid; place-items: center; border: 1.5px solid var(--blue); border-radius: 50%; color: var(--blue); background: #fff; }
.timeline-dot::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.timeline-item time { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.comments-list { display: grid; gap: 9px; max-height: 260px; overflow: auto; }
.comment { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.comment header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment strong { font-size: 11px; }
.comment time { color: var(--muted); font-size: 9px; }
.comment p { margin: 8px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.comment-form { margin-top: 12px; display: grid; justify-items: end; gap: 8px; }
.comment-form textarea { font-size: 11px; }
.comment-form .button { min-height: 35px; padding: 7px 11px; font-size: 11px; }

.actionbar { grid-column: 1 / -1; min-height: 72px; padding: 12px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 22px; border-top: 1px solid var(--line); background: #fff; }
.actionbar p { margin: 0 auto 0 0; color: var(--muted); font-size: 11px; }

.loading-state, .empty-state { min-height: calc(100vh - 152px); display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.loading-state span { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { margin-top: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state svg { width: 50px; height: 50px; color: var(--blue); }
.empty-state h2 { margin: 18px 0 5px; font-family: var(--font-display); }
.empty-state p { margin: 0; }

.toast-region { position: fixed; z-index: 50; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.toast { width: min(360px, calc(100vw - 48px)); padding: 13px 15px; border-left: 4px solid var(--blue); border-radius: 8px; color: #fff; background: var(--navy); box-shadow: var(--shadow-sm); animation: toast-in .25s ease-out both; }
.toast.is-error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.empty-inline { padding: 22px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.mobile-only { display: none; }

@media (min-width: 1181px) {
    html:has(.portal:not([hidden])),
    body:has(.portal:not([hidden])) { overflow: hidden; }
    .portal { height: min(720px, calc(100vh - 100px)); margin: 50px auto 0; }
    .portal-grid { height: calc(100% - var(--topbar-height)); min-height: 0; }
    .workspace { overflow: auto; }
    .sidebar { overflow: auto; }
    .dashboard { grid-template-columns: minmax(0, 1fr) 280px; }
}
