:root {
    color-scheme: dark;
    --bg: #0b1318;
    --panel: #111d24;
    --panel-soft: #17262e;
    --panel-hover: #1d3039;
    --border: #29404a;
    --text: #edf5f2;
    --muted: #9fb2b8;
    --mint: #64d9b2;
    --mint-dark: #173e35;
    --blue: #78b7db;
    --amber: #f2bd67;
    --rose: #ef8d8d;
    --radius: 1.05rem;
    --shadow: 0 1.4rem 4rem rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.auth-body {
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 14% 16%, rgba(100, 217, 178, .13), transparent 28rem),
        radial-gradient(circle at 90% 85%, rgba(120, 183, 219, .1), transparent 30rem),
        var(--bg);
}

.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr); width: min(100%, 960px); border: 1px solid var(--border); border-radius: 1.5rem; overflow: hidden; background: rgba(17, 29, 36, .94); box-shadow: var(--shadow); }
.auth-story { display: flex; flex-direction: column; justify-content: center; min-height: 590px; padding: clamp(2.2rem, 6vw, 5rem); background: linear-gradient(145deg, rgba(100, 217, 178, .09), transparent 55%); }
.brand-mark { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-bottom: 1.6rem; border-radius: 1rem; background: var(--mint); color: #082219; box-shadow: 0 .7rem 1.8rem rgba(100, 217, 178, .18); }
.brand-mark.small { width: 2.25rem; height: 2.25rem; margin: 0; border-radius: .72rem; font-size: .8rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--mint); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.auth-story h1 { margin: 0; font-size: clamp(3.5rem, 9vw, 6.2rem); font-weight: 760; letter-spacing: -.075em; line-height: .95; }
.auth-story h1 span, .side-brand strong span { color: var(--mint); }
.auth-lead { max-width: 29rem; margin: 1.4rem 0 2rem; color: #c8d7d8; font-size: clamp(1.25rem, 2.4vw, 1.65rem); line-height: 1.42; }
.trust-line { display: flex; align-items: center; gap: .7rem; max-width: 28rem; color: var(--muted); font-size: .93rem; }
.trust-line i { color: var(--mint); font-size: 1.15rem; }
.auth-card { align-self: center; margin: 1.5rem; padding: clamp(1.8rem, 4vw, 2.7rem); border: 1px solid var(--border); border-radius: 1.25rem; background: #101b21; }
.auth-card-icon { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; margin-bottom: 1.4rem; border-radius: .85rem; background: var(--mint-dark); color: var(--mint); }
.auth-card h2 { margin: 0; font-size: 1.55rem; }
.muted { margin: .45rem 0 1.7rem; color: var(--muted); }
.security-note { margin: 1.25rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.security-note i { margin-right: .3rem; color: var(--mint); }

.field-group { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.15rem; }
.field-group label { color: #dce8e6; font-size: .88rem; font-weight: 700; }
.field-group input, .field-group select, .field-group textarea { width: 100%; min-height: 3rem; border: 1px solid var(--border); border-radius: .78rem; outline: none; background: #0d181e; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
.field-group input, .field-group select { padding: .72rem .9rem; }
.field-group textarea { min-height: 7.5rem; padding: .9rem 1rem; line-height: 1.5; resize: vertical; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { border-color: var(--mint); background: #101d23; box-shadow: 0 0 0 .2rem rgba(100, 217, 178, .12); }
.input-with-icon, .select-with-icon { position: relative; }
.input-with-icon > i, .select-with-icon > i { position: absolute; z-index: 1; top: 50%; left: 1rem; color: #799096; transform: translateY(-50%); pointer-events: none; }
.input-with-icon input, .select-with-icon select { padding-left: 2.75rem; }
.select-with-icon select { appearance: auto; }
::placeholder { color: #70878d; opacity: 1; }

.primary-button, .ghost-button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 2.85rem; border-radius: .8rem; padding: .68rem 1.1rem; font-weight: 750; transition: transform .15s, background .15s, border-color .15s, opacity .15s; }
.primary-button { border: 0; background: var(--mint); color: #082219; box-shadow: 0 .55rem 1.5rem rgba(100, 217, 178, .15); }
.primary-button:hover { background: #7ce4c2; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .62; transform: none; }
.ghost-button { border: 1px solid var(--border); background: transparent; color: var(--muted); }
.ghost-button:hover { border-color: #49616b; background: var(--panel-soft); color: var(--text); }
.form-message { margin: 0 0 1rem; border: 1px solid rgba(239, 141, 141, .35); border-radius: .75rem; padding: .75rem .85rem; background: rgba(239, 141, 141, .09); color: #ffc1c1; font-size: .9rem; }
.form-message.success { border-color: rgba(100, 217, 178, .35); background: rgba(100, 217, 178, .09); color: #a9efd7; }

.app-body { background: radial-gradient(circle at 78% 8%, rgba(100, 217, 178, .06), transparent 30rem), var(--bg); }
.app-layout { min-height: 100vh; }
.side-panel { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 255px; padding: 1.5rem 1rem; border-right: 1px solid var(--border); background: rgba(13, 23, 29, .96); }
.side-brand { display: flex; align-items: center; gap: .8rem; padding: 0 .45rem 1.9rem; }
.side-brand strong { font-size: 1.32rem; letter-spacing: -.04em; }
.side-nav { display: flex; flex-direction: column; gap: .35rem; }
.nav-item { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 2.85rem; border: 0; border-radius: .75rem; padding: .72rem .85rem; background: transparent; color: var(--muted); text-align: left; }
.nav-item > i { width: 1.2rem; text-align: center; }
.nav-item:hover { background: var(--panel-soft); color: var(--text); }
.nav-item.active { background: var(--mint-dark); color: var(--mint); }
.count-pill { min-width: 1.3rem; margin-left: auto; border-radius: 999px; padding: .08rem .35rem; background: var(--amber); color: #322007; font-size: .7rem; font-weight: 800; text-align: center; }
.side-user { display: grid; grid-template-columns: 2.35rem 1fr; gap: .75rem; align-items: center; margin-top: auto; padding: 1rem .55rem 0; border-top: 1px solid var(--border); }
.side-user .avatar { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .8rem; background: #25424b; color: var(--mint); font-weight: 800; }
.side-user strong, .side-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user strong { font-size: .86rem; }
.side-user small { margin-top: .12rem; color: var(--muted); font-size: .72rem; }
.main-panel { width: min(100% - 255px, 1050px); min-height: 100vh; margin-left: 255px; padding: 2rem clamp(1.25rem, 4vw, 3.5rem) 5rem; }
.top-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.top-bar h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.global-message { position: sticky; top: 1rem; z-index: 4; box-shadow: var(--shadow); }
.app-view { display: none; }
.app-view.active { display: block; animation: reveal .18s ease-out; }
@keyframes reveal { from { opacity: .25; transform: translateY(4px); } }
.welcome-strip { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; border: 1px solid rgba(100, 217, 178, .2); border-radius: var(--radius); padding: 1rem 1.15rem; background: rgba(100, 217, 178, .055); }
.welcome-icon { display: grid; flex: 0 0 2.65rem; place-items: center; width: 2.65rem; height: 2.65rem; border-radius: .85rem; background: var(--mint-dark); color: var(--mint); }
.welcome-strip strong { display: block; margin-bottom: .15rem; }
.welcome-strip p { margin: 0; color: var(--muted); font-size: .9rem; }
.content-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 .8rem 2.5rem rgba(0, 0, 0, .12); }
.ask-card { padding: clamp(1.15rem, 3vw, 1.7rem); }
.field-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: -.15rem; color: #799096; font-size: .73rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: .55rem; margin: -.2rem 0 1.3rem; }
.suggestions button { border: 1px solid var(--border); border-radius: 999px; padding: .45rem .72rem; background: transparent; color: var(--muted); font-size: .78rem; }
.suggestions button:hover { border-color: #49616b; background: var(--panel-hover); color: var(--text); }
.suggestions i { margin-right: .22rem; color: var(--mint); }
.ask-button { min-width: 10.5rem; }

.answer-card { margin-top: 1rem; overflow: hidden; }
.answer-status { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(100, 217, 178, .08), transparent); }
.result-icon { display: grid; flex: 0 0 3rem; place-items: center; width: 3rem; height: 3rem; border-radius: .9rem; background: var(--mint-dark); color: var(--mint); font-size: 1.2rem; }
.answer-card.recommend .result-icon { background: rgba(242, 189, 103, .14); color: var(--amber); }
.answer-card.escalate .result-icon { background: rgba(239, 141, 141, .13); color: var(--rose); }
.answer-card h2 { margin: .1rem 0 0; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.42; }
.answer-block { padding: 1.2rem 1.5rem; border-top: 1px solid rgba(41, 64, 74, .65); }
.answer-block:first-of-type { border-top: 0; }
.answer-block h3 { margin: 0 0 .55rem; color: #c6d6d5; font-size: .82rem; font-weight: 750; }
.answer-block h3 > i { margin-right: .35rem; color: var(--amber); }
.answer-block p { margin: 0; color: var(--muted); line-height: 1.55; }
.answer-block ul { display: grid; gap: .35rem; margin: 0; padding-left: 1.15rem; color: var(--muted); font-size: .86rem; }

.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.9rem); }
.soft-badge { display: inline-flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .45rem .7rem; background: var(--mint-dark); color: #a9efd7; font-size: .74rem; font-weight: 700; }
.create-panel { margin-bottom: 1rem; overflow: hidden; }
.create-panel summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 1rem 1.2rem; color: #d9e8e4; font-weight: 750; list-style: none; }
.create-panel summary::-webkit-details-marker { display: none; }
.create-panel summary span i { margin-right: .45rem; color: var(--mint); }
.create-panel[open] summary > i { transform: rotate(180deg); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; padding: 1.2rem; border-top: 1px solid var(--border); }
.form-grid .full { grid-column: 1 / -1; }
.optional { color: var(--muted); font-size: .72rem; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; }
.card-list { display: grid; gap: .75rem; }
.list-card { border: 1px solid var(--border); border-radius: .95rem; padding: 1rem 1.15rem; background: var(--panel); }
.list-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.list-card h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
.list-card p { margin: .65rem 0 0; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.meta-row { display: flex; flex-wrap: wrap; gap: .45rem .85rem; margin-top: .75rem; color: #82989e; font-size: .72rem; }
.meta-row span { display: inline-flex; align-items: center; gap: .3rem; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: .3rem .52rem; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.status-badge.approved, .status-badge.action { background: var(--mint-dark); color: #9ce9d0; }
.status-badge.proposed, .status-badge.recommend { background: rgba(242, 189, 103, .13); color: #f7cd89; }
.status-badge.escalate { background: rgba(239, 141, 141, .12); color: #ffb2b2; }
.card-action { margin-top: .9rem; border: 1px solid var(--mint); border-radius: .65rem; padding: .48rem .75rem; background: transparent; color: var(--mint); font-size: .78rem; font-weight: 750; }
.card-action:hover { background: var(--mint-dark); }
.resolution-form { display: flex; gap: .55rem; margin-top: .9rem; }
.resolution-form input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: .7rem; padding: .6rem .75rem; background: #0d181e; color: var(--text); }
.empty-state { display: grid; place-items: center; min-height: 11rem; border: 1px dashed var(--border); border-radius: var(--radius); padding: 2rem; color: var(--muted); text-align: center; }
.empty-state i { margin-bottom: .65rem; color: var(--mint); font-size: 1.35rem; }
.empty-state p { margin: 0; }

.info-tip { position: relative; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; margin: 0; border: 0; padding: 0; background: transparent; color: #789098; vertical-align: -.08rem; }
.info-tip:hover, .info-tip:focus-visible { color: var(--mint); outline: none; }
.info-tip::after { position: absolute; z-index: 20; bottom: calc(100% + .55rem); left: 50%; width: min(17rem, 70vw); border: 1px solid #3c5661; border-radius: .65rem; padding: .6rem .7rem; background: #091218; box-shadow: var(--shadow); color: #dce8e6; content: attr(data-tooltip); font-size: .72rem; font-weight: 500; line-height: 1.4; opacity: 0; pointer-events: none; text-align: left; transform: translate(-50%, .25rem); transition: opacity .14s, transform .14s; }
.info-tip:hover::after, .info-tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.status-card { width: min(100%, 430px); border: 1px solid var(--border); border-radius: 1.2rem; padding: 2rem; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.status-card .status-icon { color: var(--mint); font-size: 2rem; }
.status-card h1 { margin: 1rem 0 .6rem; font-size: 1.5rem; }
.status-card p { margin: 0; color: var(--muted); }
.mobile-nav { display: none; }

button:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

@media (max-width: 760px) {
    .auth-body { padding: 0; place-items: stretch; }
    .auth-shell { grid-template-columns: 1fr; width: 100%; min-height: 100vh; border: 0; border-radius: 0; }
    .auth-story { min-height: auto; padding: 2.2rem 1.4rem 1.2rem; }
    .auth-story .brand-mark { width: 2.65rem; height: 2.65rem; margin-bottom: 1.1rem; }
    .auth-story h1 { font-size: 3.4rem; }
    .auth-lead { margin: .85rem 0 1rem; font-size: 1.15rem; }
    .trust-line { font-size: .8rem; }
    .auth-card { align-self: start; margin: 1rem; padding: 1.45rem; }
    .side-panel { display: none; }
    .main-panel { width: 100%; margin: 0; padding: 1.15rem 1rem 6.5rem; }
    .top-bar { margin-bottom: 1.2rem; }
    .top-bar .ghost-button span { display: none; }
    .top-bar .ghost-button { min-width: 2.75rem; padding: .6rem; }
    .welcome-strip { align-items: flex-start; }
    .field-footer span:first-child { display: none; }
    .field-footer { justify-content: flex-end; }
    .suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
    .suggestions button { flex: 0 0 auto; }
    .ask-button { width: 100%; }
    .section-heading { align-items: flex-start; }
    .soft-badge { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: 1; }
    .resolution-form { flex-direction: column; }
    .mobile-nav { position: fixed; z-index: 10; right: .7rem; bottom: .7rem; left: .7rem; display: flex; justify-content: space-around; min-height: 4.25rem; border: 1px solid var(--border); border-radius: 1.05rem; padding: .38rem; background: rgba(13, 23, 29, .96); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
    .mobile-nav button { display: grid; flex: 1; place-items: center; gap: .1rem; border: 0; border-radius: .78rem; padding: .35rem .25rem; background: transparent; color: var(--muted); font-size: .65rem; }
    .mobile-nav button i { font-size: 1rem; }
    .mobile-nav button.active { background: var(--mint-dark); color: var(--mint); }
    .info-tip::after { position: fixed; right: 1rem; bottom: 5.7rem; left: 1rem; width: auto; transform: translateY(.25rem); }
    .info-tip:hover::after, .info-tip:focus-visible::after { transform: translateY(0); }
}
