/* Asahi TIPO Operations Hub · v3 */
:root {
    color-scheme: dark;
    --p-bg: #0a1120;
    --p-bg-soft: #111c30;
    --p-surface: #121e32;
    --p-surface-2: #17253b;
    --p-border: #293a52;
    --p-text: #f4f7fe;
    --p-muted: #a5b5ce;
    --p-subtle: #8196b3;
    --p-primary: #7c9aff;
    --p-primary-strong: #5579ed;
    --p-primary-contrast: #ffffff;
    --p-blue-wash: rgba(105, 145, 255, .13);
    --p-shadow: 0 24px 64px rgba(0, 0, 0, .23);
}
html[data-theme="light"] {
    color-scheme: light;
    --p-bg: #f5f7fc;
    --p-bg-soft: #edf2fa;
    --p-surface: #ffffff;
    --p-surface-2: #f7f9fe;
    --p-border: #dce4f0;
    --p-text: #17243a;
    --p-muted: #52657f;
    --p-subtle: #667a96;
    --p-primary: #365ad0;
    --p-primary-strong: #365ad0;
    --p-primary-contrast: #ffffff;
    --p-blue-wash: rgba(63, 94, 192, .08);
    --p-shadow: 0 26px 68px rgba(39, 65, 109, .10);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body.portal-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background: var(--p-bg);
    color: var(--p-text);
}
.portal-body a { color: inherit; text-decoration: none; }
.portal-body button, .portal-body input { font: inherit; }
.portal-body button { cursor: pointer; }
.portal-body :focus-visible { outline: 3px solid var(--p-primary); outline-offset: 3px; }
.skip-link { position: absolute; left: 14px; top: -70px; z-index: 9999; border-radius: 9px; background: #fff; color: #17243a!important; padding: 10px 15px; }
.skip-link:focus { top: 12px; }
.portal-layout { min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.portal-header {
    width: min(1320px, 100%);
    padding: 22px clamp(20px, 4.4vw, 62px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    z-index: 3;
}
.portal-brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; }
.portal-brand-image { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 15px; border: 1px solid var(--p-border); background: var(--p-surface); }
.portal-brand-image img { width: 42px; height: 42px; object-fit: contain; }
.portal-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.portal-brand-text strong { letter-spacing: .1em; font-weight: 900; font-size: 17px; }
.portal-brand-text strong span { color: var(--p-primary); }
.portal-brand-text small { margin-top: 5px; color: var(--p-subtle); font-weight: 750; letter-spacing: .14em; font-size: 9px; }
.portal-header-actions { display: flex; align-items: center; gap: 13px; }
.portal-icon-button, .portal-signout {
    min-height: 42px;
    border: 1px solid var(--p-border);
    background: var(--p-surface);
    color: var(--p-text);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, transform .18s, border-color .18s;
}
.portal-icon-button { width: 42px; font-size: 18px; }
.portal-icon-button:hover, .portal-signout:hover { background: var(--p-surface-2); border-color: var(--p-primary); transform: translateY(-1px); }
.portal-signout { padding: 0 14px; gap: 9px; font-size: 12px; font-weight: 800; }
.portal-logout-form { margin: 0; }
.portal-user { display: inline-flex; gap: 10px; align-items: center; padding-right: 8px; }
.portal-avatar { border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; background: var(--p-blue-wash); color: var(--p-primary); border: 1px solid var(--p-border); }
.portal-user-text { display: flex; flex-direction: column; line-height: 1.35; }
.portal-user-text strong { font-weight: 800; font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-user-text small { color: var(--p-subtle); font-size: 11px; }
.portal-secure { font-size: 12px; color: var(--p-muted); display: inline-flex; align-items: center; gap: 8px; }
.portal-secure i { font-size: 16px; color: #61cdb1; }
.portal-footer {
    width: min(1320px, 100%);
    margin: auto auto 0;
    padding: 24px clamp(20px, 4.4vw, 62px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--p-subtle);
    font-size: 11px;
}
.portal-eyebrow, .portal-section-kicker { font-size: 11px; text-transform: uppercase; font-weight: 850; letter-spacing: .17em; color: var(--p-primary); }

/* Logged-in workspace selection */
.portal-logged-in {
    background:
        radial-gradient(ellipse at 82% -24%, rgba(60, 111, 217, .16), transparent 46%),
        var(--p-bg);
}
.hub-main { width: min(1210px, 100%); margin: 38px auto 66px; padding: 0 24px; }
.hub-error { display:flex;align-items:center;gap:10px;margin-bottom:20px;padding:12px 15px;border:1px solid #a34f63;border-radius:12px;background:rgba(197,67,91,.13);color:#ffd7de;font-size:13px; }
html[data-theme="light"] .hub-error { color:#922c41;background:#fff1f3;border-color:#f4b4c0; }
.hub-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 265px;
    align-items: center;
    gap: 22px;
    padding: clamp(26px, 4.6vw, 54px);
    min-height: 270px;
    border: 1px solid var(--p-border);
    border-radius: 28px;
    background:
        radial-gradient(ellipse at 95% 5%, rgba(90, 120, 235, .19), transparent 45%),
        linear-gradient(115deg, var(--p-surface), var(--p-bg-soft));
    overflow: hidden;
    position: relative;
}
.portal-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #49cca3; box-shadow: 0 0 0 4px rgba(73, 204, 163, .13); margin-right: 10px; }
.hub-intro h1 { margin: 17px 0 12px; font-size: clamp(29px, 4vw, 45px); line-height: 1.15; letter-spacing: -.045em; font-weight: 850; }
.hub-intro p { color: var(--p-muted); max-width: 540px; margin: 0; font-size: 14px; line-height: 1.8; }
.hub-intro-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 13px 23px; margin-top: 25px; color: var(--p-subtle); font-weight: 600; font-size: 12px; }
.hub-intro-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hub-intro-meta i { color: var(--p-primary); }
.hub-intro-art { position: relative; width: 235px; height: 215px; justify-self: center; display: grid; place-items: center; color: #d8e4ff; }
.hub-art-grid { position: absolute; inset: 0; border: 1px solid rgba(110, 149, 243, .28); border-radius: 32px; transform: rotate(-13deg); background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(110, 149, 243, .07) 28px 29px), repeating-linear-gradient(90deg, transparent 0 27px, rgba(110, 149, 243, .07) 28px 29px); }
.hub-intro-art > i { font-size: 83px; color: var(--p-primary); filter: drop-shadow(0 15px 30px rgba(75, 103, 220, .27)); }
.hub-art-orbit { position: absolute; width: 28px; height: 28px; background: #5ad3b3; border: 6px solid var(--p-surface); border-radius: 50%; top: 20px; right: 4px; box-shadow: 0 0 0 1px var(--p-border); }
.hub-section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 44px 0 20px; }
.hub-section-head h2 { font-size: clamp(19px, 2.2vw, 24px); margin: 7px 0 0; font-weight: 850; letter-spacing: -.032em; }
.hub-count { color: var(--p-subtle); font-size: 12px; white-space: nowrap; padding-bottom: 4px; }
.hub-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.hub-module {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: clamp(23px, 3vw, 31px);
    border-radius: 24px;
    border: 1px solid var(--p-border);
    background: var(--p-surface);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
    overflow: hidden;
}
.hub-module:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #7096ff, #83c4fe); opacity: .65; }
.hub-module-docgen:before { background: linear-gradient(90deg, #48c7b4, #7ddbd9); }
.hub-module:hover { transform: translateY(-4px); border-color: var(--p-primary); box-shadow: var(--p-shadow); }
.hub-module:focus-visible { outline-offset: 4px; }
.hub-module-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.hub-module-icon { display: grid; place-items: center; width: 59px; height: 59px; flex: 0 0 59px; border-radius: 18px; background: rgba(91, 140, 247, .14); color: #8cafff; font-size: 26px; }
.hub-module-docgen .hub-module-icon { background: rgba(53, 188, 165, .13); color: #56cdb4; }
html[data-theme="light"] .hub-module-stock .hub-module-icon { color: #365ad0; }
html[data-theme="light"] .hub-module-docgen .hub-module-icon { color: #117f70; }
.hub-module-state { font-size: 10px; color: var(--p-muted); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--p-border); border-radius: 100px; padding: 6px 10px; }
.hub-state-dot { width: 6px; height: 6px; background: #42bc98; border-radius: 50%; }
.hub-module h3 { font-size: 23px; font-weight: 850; margin: 0 0 9px; letter-spacing: -.03em; }
.hub-module p { color: var(--p-muted); margin: 0; font-size: 13px; max-width: 390px; line-height: 1.75; }
.hub-module-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 19px 0 26px; }
.hub-module-tags span { border-radius: 7px; border: 1px solid var(--p-border); padding: 5px 8px; color: var(--p-subtle); background: var(--p-surface-2); font-size: 10px; font-weight: 650; }
.hub-module-action { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--p-primary); border-top: 1px solid var(--p-border); padding-top: 18px; }
.hub-module-action i { font-size: 19px; transition: transform .2s; }
.hub-module:hover .hub-module-action i { transform: translate(3px, -3px); }
.hub-bottom-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 22px; }
.hub-notice, .hub-planned { display: flex; align-items: flex-start; gap: 15px; padding: 20px 22px; border: 1px solid var(--p-border); border-radius: 19px; background: var(--p-surface-2); }
.hub-notice-icon, .hub-planned-icon { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--p-blue-wash); color: var(--p-primary); font-size: 18px; }
.hub-notice h3, .hub-planned h3 { font-size: 13px; font-weight: 800; margin: 1px 0 6px; }
.hub-notice p, .hub-planned p { font-size: 12px; margin: 0; color: var(--p-muted); line-height: 1.65; }
.hub-planned .portal-section-kicker { font-size: 9px; display: block; margin-bottom: 5px; }

/* Unauthenticated sign-in screen */
.portal-logged-out { background: var(--p-bg); }
.signin-main {
    max-width: 1260px;
    width: 100%;
    margin: auto;
    padding: 24px clamp(24px, 5.2vw, 70px) 58px;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    gap: clamp(48px, 7.5vw, 112px);
    align-items: center;
}
.signin-story { min-width: 0; }
.signin-badge { border: 1px solid var(--p-border); border-radius: 100px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 8px; color: var(--p-muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; }
.signin-badge i { color: #72dbc0; font-size: 15px; }
.signin-story h1 { font-size: clamp(38px, 4.9vw, 68px); letter-spacing: -.065em; font-weight: 880; line-height: 1.06; max-width: 590px; margin: 27px 0 22px; }
.signin-story h1 em { font-style: normal; color: #8ca8ff; }
html[data-theme="light"] .signin-story h1 em { color: #365ad0; }
.signin-story > p { font-size: clamp(14px, 1.4vw, 16px); line-height: 1.85; max-width: 440px; margin: 0; color: var(--p-muted); }
.signin-illustration { height: 295px; position: relative; margin: 28px 0 8px; display: flex; align-items: center; padding-left: 24px; }
.illustration-glow { position: absolute; width: 320px; height: 240px; left: 13%; top: 20px; background: #4873dc; opacity: .13; filter: blur(65px); border-radius: 50%; }
.illustration-window { position: relative; width: min(390px, 95%); height: 225px; border-radius: 21px; border: 1px solid #42618a; background: linear-gradient(160deg, #172a48, #101d34); transform: perspective(900px) rotateY(-8deg) rotateX(3deg); box-shadow: 25px 28px 55px rgba(0,0,0,.25); padding: 20px; }
.illustration-window-top { display: flex; gap: 5px; margin-bottom: 24px; }
.illustration-window-top span { width: 7px; height: 7px; border-radius: 50%; background: #476588; }
.illustration-window-top span:first-child { background: #6f9ff3; }
.illustration-line { height: 9px; width: 65%; border-radius: 8px; background: #344d70; margin-top: 15px; }
.illustration-line-wide { width: 45%; background: #809fe5; margin-top: 0; }
.illustration-line-short { width: 43%; opacity: .45; }
.illustration-tiles { display: flex; gap: 13px; margin-top: 20px; }
.illustration-tiles div { flex: 1; border-radius: 12px; height: 81px; border: 1px solid #345275; background: #1d3457; display: flex; flex-direction: column; align-items: flex-start; padding: 12px; gap: 7px; }
.illustration-tiles i { font-size: 19px; color: #94b7fe; line-height: 1; }
.illustration-tiles span { height: 5px; width: 65%; border-radius: 5px; background: #53729a; }
.illustration-tiles span:last-child { width: 43%; opacity: .55; }
.illustration-float { position: absolute; bottom: 5px; right: 2px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #405f79; border-radius: 12px; padding: 12px 15px; color: #f3f8ff; background: #1c3a50; box-shadow: 0 10px 25px rgba(0,0,0,.2); font-size: 11px; font-weight: 750; }
.illustration-float i { color: #58e4b4; font-size: 19px; }
.signin-story-footer { display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--p-subtle); font-size: 11px; margin-top: 17px; }
.signin-story-footer span { display: inline-flex; align-items: center; gap: 8px; }
.signin-story-footer i { color: #5bc9ac; }
.signin-panel { min-width: 0; }
.signin-card { border: 1px solid var(--p-border); border-radius: 27px; background: var(--p-surface); box-shadow: var(--p-shadow); padding: clamp(27px, 3.8vw, 46px); }
.signin-symbol { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--p-blue-wash); color: var(--p-primary); font-size: 23px; margin-bottom: 25px; }
.signin-card h2 { font-size: clamp(23px, 2.4vw, 29px); font-weight: 850; letter-spacing: -.038em; margin: 8px 0; }
.signin-description { color: var(--p-muted); font-size: 13px; line-height: 1.75; margin: 0 0 30px; }
.signin-form { display: grid; gap: 20px; }
.signin-field label { display: block; color: var(--p-text); font-size: 12px; font-weight: 750; margin-bottom: 9px; }
.signin-input-wrap { position: relative; display: flex; align-items: center; }
.signin-input-wrap > i { position: absolute; left: 16px; font-size: 18px; color: var(--p-subtle); pointer-events: none; }
.signin-input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--p-border);
    border-radius: 13px;
    background: var(--p-surface-2);
    color: var(--p-text);
    padding: 0 16px 0 47px;
    outline: none;
    font-size: 13px;
    transition: border-color .18s, box-shadow .18s;
}
.signin-input::placeholder { color: var(--p-subtle); opacity: 1; }
.signin-input:focus { border-color: var(--p-primary); box-shadow: 0 0 0 4px var(--p-blue-wash); }
.signin-password-input { padding-right: 57px; }
.signin-password-toggle { position: absolute; right: 7px; top: 5px; width: 42px; height: 42px; display: grid; place-items: center; background: transparent; border: 0; color: var(--p-muted); font-size: 18px; border-radius: 10px; }
.signin-password-toggle:hover { background: var(--p-blue-wash); color: var(--p-text); }
.signin-submit { min-height: 54px; padding: 0 18px; border: 0; border-radius: 13px; background: linear-gradient(110deg, #4d71ed, #7189f5); color: #fff; font-weight: 800; font-size: 13px; margin-top: 5px; display: flex; align-items: center; justify-content: space-between; transition: filter .15s, transform .15s; }
.signin-submit:hover { filter: brightness(1.11); transform: translateY(-1px); }
.signin-submit i { font-size: 18px; }
.signin-help { display: flex; align-items: flex-start; gap: 8px; padding-top: 23px; border-top: 1px solid var(--p-border); margin-top: 27px; color: var(--p-subtle); font-size: 11px; line-height: 1.6; }
.signin-help i { font-size: 15px; flex: 0 0 15px; }
.signin-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 23px; border-radius: 11px; border: 1px solid #a34f63; color: #ffd7de; background: rgba(197, 67, 91, .15); font-size: 12px; }
html[data-theme="light"] .signin-error { color: #922c41; background: #fff1f3; border-color: #f4b4c0; }
.signin-error i { flex: 0 0 16px; }

@media (max-width: 980px) {
    .signin-main { grid-template-columns: .85fr 1fr; gap: 30px; }
    .signin-story h1 { font-size: clamp(34px, 5vw, 53px); }
    .signin-illustration { padding-left: 0; }
    .illustration-float { right: 0; }
}
@media (max-width: 760px) {
    .hub-main { margin: 20px auto 50px; padding: 0 18px; }
    .hub-intro { grid-template-columns: 1fr; padding: 30px; min-height: 0; }
    .hub-intro-art { display: none; }
    .hub-modules { gap: 14px; }
    .hub-module { padding: 22px; }
    .hub-bottom-row { grid-template-columns: 1fr; gap: 13px; }
    .signin-main { grid-template-columns: 1fr; padding: 20px 22px 44px; gap: 28px; max-width: 570px; }
    .signin-story { text-align: center; }
    .signin-story h1 { max-width: 450px; margin: 20px auto 13px; }
    .signin-story > p { margin: auto; }
    .signin-illustration, .signin-story-footer { display: none; }
    .signin-card { padding: 32px; }
}
@media (max-width: 560px) {
    .portal-header { padding: 17px 18px; }
    .portal-brand-image { width: 43px; height: 43px; flex-basis: 43px; }
    .portal-brand-image img { width: 37px; height: 37px; }
    .portal-brand-text strong { font-size: 14px; }
    .portal-brand-text small { font-size: 8px; letter-spacing: .08em; }
    .portal-header-actions { gap: 7px; }
    .portal-user, .portal-secure { display: none; }
    .portal-signout { padding: 0 11px; }
    .portal-signout span { display: none; }
    .portal-icon-button, .portal-signout { width: 41px; height: 41px; min-height: 41px; }
    .hub-intro { padding: 25px 21px; border-radius: 20px; }
    .hub-intro h1 { font-size: 29px; }
    .hub-intro-meta { gap: 10px; }
    .hub-section-head { align-items: flex-start; margin: 31px 0 17px; }
    .hub-count { display: none; }
    .hub-modules { grid-template-columns: 1fr; }
    .hub-module { min-height: 286px; border-radius: 19px; }
    .hub-module-top { margin-bottom: 18px; }
    .hub-module h3 { font-size: 21px; }
    .hub-bottom-row { margin-top: 14px; }
    .hub-notice, .hub-planned { padding: 17px; }
    .signin-main { padding: 17px 17px 35px; }
    .signin-badge { font-size: 8px; }
    .signin-story h1 { font-size: 37px; }
    .signin-card { padding: 25px 21px; border-radius: 22px; }
    .portal-footer { padding: 18px; flex-direction: column; align-items: flex-start; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
