:root {
    color-scheme: dark;
    --bg: #07100f;
    --panel: rgba(15, 29, 27, 0.86);
    --panel-solid: #10201e;
    --panel-light: #172b28;
    --text: #f4f8f6;
    --muted: #91a49f;
    --line: rgba(152, 184, 174, 0.16);
    --accent: #45e0a8;
    --accent-strong: #1fc98f;
    --accent-soft: rgba(69, 224, 168, 0.12);
    --warning: #f4bd61;
    --warning-soft: rgba(244, 189, 97, 0.1);
    --danger: #ff7d82;
    --shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(40, 177, 132, 0.13), transparent 34rem),
        radial-gradient(circle at 95% 70%, rgba(45, 119, 154, 0.1), transparent 35rem),
        var(--bg);
}

button, input, select { font: inherit; }

button { color: inherit; }

.hidden { display: none !important; }

.ambient {
    position: fixed;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    pointer-events: none;
}

.ambient-one { top: -12rem; right: 8%; background: var(--accent); }
.ambient-two { bottom: -14rem; left: -8rem; background: #3a7cab; }

.shell { position: relative; width: min(1440px, 100%); margin: 0 auto; padding: 2rem; }

.auth-layout {
    min-height: calc(100vh - 4rem);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(3rem, 8vw, 9rem);
    padding: clamp(2rem, 6vw, 7rem);
}

.brand-mark {
    width: 3.5rem;
    height: 3.5rem;
    display: inline-grid;
    place-items: center;
    border-radius: 1.15rem;
    font-size: 1.45rem;
    font-weight: 900;
    color: #06110e;
    background: linear-gradient(145deg, #6cf4c2, #24bb87);
    box-shadow: 0 12px 40px rgba(69, 224, 168, 0.24);
}

.brand-mark.small { width: 2.6rem; height: 2.6rem; border-radius: 0.8rem; font-size: 1.05rem; }

.eyebrow {
    margin: 1.8rem 0 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--accent);
}

.brand-panel h1 {
    max-width: 13ch;
    margin: 0;
    font-size: clamp(2.7rem, 5.6vw, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.lead { max-width: 42rem; margin: 1.7rem 0; color: var(--muted); font-size: 1.05rem; line-height: 1.85; }

.capability-card, .warning-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid rgba(244, 189, 97, 0.2);
    background: var(--warning-soft);
}

.capability-card { max-width: 31rem; margin-top: 2.2rem; padding: 1rem 1.15rem; border-radius: 1rem; }
.capability-card div { display: grid; gap: 0.2rem; }
.capability-card small, .warning-banner span { color: #c6b48e; }

.status-dot { width: 0.55rem; height: 0.55rem; flex: 0 0 auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 0.35rem rgba(244, 189, 97, 0.1); }

.auth-card, .content-card, .balance-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.auth-card { width: min(100%, 31rem); justify-self: end; padding: clamp(1.6rem, 4vw, 2.7rem); border-radius: 1.5rem; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-bottom: 2rem; padding: 0.3rem; border-radius: 0.85rem; background: rgba(0, 0, 0, 0.18); }

.tab, .nav-button, .ghost-button {
    border: 0;
    cursor: pointer;
    transition: 160ms ease;
}

.tab { padding: 0.75rem; border-radius: 0.65rem; color: var(--muted); background: transparent; }
.tab.active { color: var(--text); background: var(--panel-light); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16); }

.form-stack { display: grid; gap: 1.25rem; }
.form-stack > div { display: grid; gap: 0.55rem; }

label { font-size: 0.83rem; font-weight: 700; color: #c7d4d0; }

input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    outline: none;
    color: var(--text);
    background: rgba(5, 14, 13, 0.72);
    padding: 0.9rem 1rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus { border-color: rgba(69, 224, 168, 0.62); box-shadow: 0 0 0 0.22rem rgba(69, 224, 168, 0.09); }

.primary-button {
    min-height: 3rem;
    margin-top: 0.2rem;
    border: 0;
    border-radius: 0.85rem;
    cursor: pointer;
    font-weight: 850;
    color: #06110e;
    background: linear-gradient(135deg, #5de9b6, #20be86);
    box-shadow: 0 12px 34px rgba(32, 190, 134, 0.18);
    transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.primary-button:disabled, .ghost-button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.message { min-height: 1.3rem; margin: 1rem 0 0; font-size: 0.86rem; color: var(--danger); }
.message.success { color: var(--accent); }
.privacy-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.6; }

.application { min-height: calc(100vh - 4rem); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.35rem 0 1.3rem; border-bottom: 1px solid var(--line); }
.brand-inline, .user-menu, .user-meta { display: flex; align-items: center; gap: 0.85rem; }
.brand-inline div, .user-meta { display: grid; gap: 0.2rem; }
.brand-inline small, .user-meta strong { color: var(--muted); }
.user-meta { text-align: right; }
.user-meta strong { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; }

.role-badge, .status-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    border-radius: 99rem;
    padding: 0.24rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
}

.ghost-button { padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 0.7rem; color: #dce7e3; background: rgba(255, 255, 255, 0.025); }
.ghost-button:hover { border-color: rgba(69, 224, 168, 0.4); color: var(--accent); }
.ghost-button.danger { color: var(--danger); }

.warning-banner { margin: 1.25rem 0; padding: 0.75rem 1rem; border-radius: 0.85rem; font-size: 0.82rem; }

.navigation { display: flex; gap: 0.35rem; margin: 1.25rem 0 1.6rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: 0.9rem; background: rgba(8, 19, 17, 0.68); overflow-x: auto; }
.nav-button { flex: 0 0 auto; padding: 0.72rem 1rem; border-radius: 0.65rem; color: var(--muted); background: transparent; }
.nav-button.active { color: var(--text); background: var(--panel-light); }
.global-message { margin: -0.6rem 0 1rem; }

.panel { animation: fade-in 220ms ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; }
.balance-card { min-height: 10rem; padding: 1.4rem; border-radius: 1.1rem; box-shadow: none; }
.primary-card { border-color: rgba(69, 224, 168, 0.23); background: linear-gradient(145deg, rgba(32, 84, 69, 0.76), rgba(13, 32, 29, 0.9)); }
.balance-card p { margin: 0 0 1.15rem; color: var(--muted); font-size: 0.82rem; }
.balance-card div { display: flex; align-items: baseline; gap: 0.55rem; }
.balance-card strong { font-size: clamp(1.55rem, 3vw, 2.6rem); letter-spacing: -0.04em; }
.balance-card span, .balance-card small { color: var(--muted); font-size: 0.75rem; }
.balance-card small { display: block; margin-top: 0.9rem; }

.content-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; margin-top: 1rem; }
.content-card { padding: 1.35rem; border-radius: 1.1rem; box-shadow: none; }
.card-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-heading { margin-bottom: 1.1rem; }
.card-heading h2, .card-heading h3, .section-heading h2 { margin: 0; letter-spacing: -0.025em; }
.card-heading p, .section-heading p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.card-heading .eyebrow, .section-heading .eyebrow { margin-top: 0; color: var(--accent); }
.section-heading { margin-bottom: 1rem; }
.section-heading > p { max-width: 34rem; text-align: right; }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.action-tile { min-height: 7.5rem; display: flex; flex-direction: column; justify-content: space-between; text-align: left; border: 1px solid var(--line); border-radius: 0.9rem; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, 0.018); padding: 1rem; transition: 160ms ease; }
.action-tile:hover { transform: translateY(-2px); border-color: rgba(69, 224, 168, 0.32); background: var(--accent-soft); }
.action-tile span { color: var(--muted); font-size: 0.75rem; line-height: 1.5; }

.status-list { display: grid; gap: 0.8rem; margin: 0; }
.status-list div { display: flex; justify-content: space-between; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.status-list div:last-child { padding: 0; border: 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 800; }
.status-list .ok { color: var(--accent); }
.status-list .off { color: var(--warning); }

.form-card { max-width: 42rem; }
.field-row { display: grid !important; grid-template-columns: 0.7fr 1.3fr; gap: 0.8rem !important; }
.p2p-grid { grid-template-columns: 0.72fr 1.28fr; }
.table-card { min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th { padding: 0.7rem; color: var(--muted); font-size: 0.68rem; text-align: left; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--line); }
td { padding: 0.85rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; }
.muted { color: var(--muted); }
.positive { color: var(--accent); }
.negative { color: var(--danger); }
.table-action { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 0.55rem; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, 0.03); }
.table-action:hover { border-color: var(--accent); }
.empty-row { padding: 2rem; color: var(--muted); text-align: center; }

.admin-grid { display: grid; gap: 1rem; }

@media (max-width: 1000px) {
    .auth-layout { grid-template-columns: 1fr; gap: 2.5rem; padding: 2rem; }
    .brand-panel h1 { max-width: none; }
    .auth-card { justify-self: stretch; width: 100%; }
    .hero-grid { grid-template-columns: 1fr 1fr; }
    .primary-card { grid-column: 1 / -1; }
    .content-grid, .p2p-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .shell { padding: 1rem; }
    .auth-layout { min-height: calc(100vh - 2rem); padding: 1rem 0; }
    .brand-panel h1 { font-size: 2.65rem; }
    .topbar { align-items: flex-start; }
    .brand-inline small { display: none; }
    .user-meta strong { max-width: 9rem; }
    .warning-banner { align-items: flex-start; flex-wrap: wrap; }
    .hero-grid { grid-template-columns: 1fr; }
    .primary-card { grid-column: auto; }
    .quick-actions { grid-template-columns: 1fr; }
    .action-tile { min-height: 5.2rem; }
    .section-heading { align-items: flex-start; }
    .section-heading > p { display: none; }
    .field-row { grid-template-columns: 1fr; }
}
