* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; background: #F4F4F4; }

.hidden { display: none !important; }

/* ─── Login ─── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2196F3 0%, #7B42F6 100%);
}
.login-container { width: 100%; max-width: 440px; padding: 20px; }
.login-card {
    background: #fff; border-radius: 16px; padding: 34px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 24px; color: #2196F3; }
.login-header p { color: #666; margin-top: 5px; }

.login-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid #eee; }
.login-tab {
    flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
    font-size: 15px; font-weight: 600; color: #888;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.login-tab.active { color: #2196F3; border-color: #2196F3; }

.form-group { margin-bottom: 18px; }
label {
    display: block; font-weight: 600; margin-bottom: 6px;
    font-size: 14px; color: #333;
}
label .req { font-weight: 400; font-size: 12px; color: #999; }
.form-hint { margin-top: 6px; font-size: 13px; font-weight: 600; }
.form-hint.uid-ok { color: #2e7d32; }
.form-hint.uid-taken { color: #d32f2f; }
input {
    width: 100%; padding: 12px 16px; border: 1.5px solid #ddd;
    border-radius: 10px; font-size: 15px; transition: .2s;
}
input:focus { outline: none; border-color: #2196F3; box-shadow: 0 0 0 3px rgba(33,150,243,.15); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.btn {
    display: inline-block; padding: 12px 24px; border: none; border-radius: 10px;
    font-size: 16px; font-weight: 600; cursor: pointer; transition: .2s; color: #fff;
}
.btn-primary { background: #2196F3; }
.btn-primary:hover { background: #1976D2; }
.btn-block { width: 100%; }
.btn-green { background: #22c55e; }
.btn-green:hover { background: #16a34a; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-red { background: #dc2626; }
.btn-red:hover { background: #b91c1c; }

.link-btn {
    display: block; text-align: center; margin-top: 16px;
    color: #2196F3; font-size: 14px; font-weight: 600;
    text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

.otp-row { display: flex; gap: 10px; }
.otp-row input { flex: 1; }
.otp-row .btn { white-space: nowrap; }

/* ─── App-style header (mirrors app AppBar) ─── */
.topbar {
    background: #2196F3; color: #fff; padding: 14px 24px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: 0 2px 10px rgba(33,150,243,.25);
}
.tb-brand { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.tb-title {
    font-size: 15px; font-weight: 600; opacity: .92;
    background: rgba(255,255,255,.14); padding: 6px 14px; border-radius: 20px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tb-user { font-size: 13px; opacity: .95; font-weight: 600; }
.topbar .logout-btn {
    color: #fff; text-decoration: none; font-size: 13px; font-weight: 700;
    background: rgba(255,255,255,.18); padding: 8px 16px; border-radius: 20px;
}

/* ─── Navigation (mirrors app drawer tiles) ─── */
.navbar {
    max-width: 1030px; margin: 16px auto 0; padding: 10px;
    background: #fff; border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
    display: flex; gap: 6px; flex-wrap: wrap;
}
.nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    color: #374151; text-decoration: none;
    font-size: 14px; font-weight: 600;
    transition: .15s;
}
.nav-ico { font-size: 17px; }
.nav-item:hover { background: #eff6ff; color: #1976D2; }
.nav-item.active { background: #2196F3; color: #fff; }

.content { max-width: 1030px; margin: 26px auto; padding: 0 20px 40px; }

/* ─── Cards (app: white, radius 16, soft shadow) ─── */
.card {
    background: #fff; border-radius: 16px; padding: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06); margin-bottom: 16px;
}
.card h3 { font-size: 17px; color: #333; margin-bottom: 16px; }

.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 24px; color: #1f2937; }
.page-head p { color: #666; margin-top: 4px; }

/* ─── Home stats row (mirrors app _statCard) ─── */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 12px; border-radius: 14px; color: #fff;
    box-shadow: 0 6px 14px rgba(0,0,0,.18);
    overflow: hidden; white-space: nowrap;
}
.stat-card span { font-size: 13px; font-weight: 600; }
.stat-card b { font-size: 16px; font-weight: 800; }
.stat-card.blue { background: #2196F3; box-shadow: 0 6px 14px rgba(33,150,243,.3); }
.stat-card.green { background: #22c55e; box-shadow: 0 6px 14px rgba(34,197,94,.3); }
.stat-card.big { justify-content: space-between; }

/* ─── Status bar (mirrors app _statusBar) ─── */
.status-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
}
.s-label { font-weight: 700; color: #1f2937; font-size: 16px; }
.s-pill {
    border: none; cursor: pointer; color: #fff; font-weight: 700;
    font-size: 14px; padding: 8px 22px; border-radius: 20px;
}
.s-pill.green { background: #22c55e; }
.s-pill.orange { background: #f59e0b; }
.s-pill.grey { background: #9ca3af; }

/* ─── Welcome card (mirrors app) ─── */
.welcome-card { text-align: center; }
.welcome-card .w-icon { display: flex; justify-content: center; margin-bottom: 14px; }
.welcome-card .w-icon svg { width: 64px; height: 64px; }
.welcome-card h3 { font-size: 20px; color: #1f2937; }
.welcome-card .w-name { font-size: 16px; color: #1f2937; margin: 14px 0 6px; }
.welcome-card .w-code { font-size: 16px; color: #2196F3; font-weight: 600; margin-bottom: 12px; }
.welcome-card p { line-height: 1.5; }

.code-bar {
    display: flex; align-items: center; gap: 10px; padding: 14px 18px;
}
.code-bar span { font-size: 20px; }
.code-bar p { font-size: 16px; font-weight: 700; color: #111827; }
.code-bar .code-val { color: #2196F3; }

.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.list-head h3 { margin-bottom: 0; }
.total-chip {
    background: #eff6ff; color: #2196F3; font-weight: 700; font-size: 14px;
    padding: 5px 14px; border-radius: 20px;
}

/* ─── AI chat bubbles (mirrors app aiMessage / answerChip) ─── */
.ai-msg { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 8px; }
.ai-av {
    width: 34px; height: 34px; min-width: 34px; border-radius: 50%;
    background: #7B42F6; color: #fff; font-size: 17px;
    display: flex; align-items: center; justify-content: center;
}
.ai-bubble {
    background: #fff; border-radius: 18px; padding: 11px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,.08);
    font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.45;
}
.ans-chip {
    margin: 4px 0 10px; padding: 9px 18px; border-radius: 20px;
    background: #7B42F6; color: #fff; font-size: 15px; font-weight: 700;
    display: inline-block;
}
.ans-wrap { text-align: right; }

/* ─── Select dropdown (mirrors app dropdown) ─── */
.select {
    width: 100%; padding: 12px 16px; border: 1.5px solid #ddd;
    border-radius: 14px; font-size: 15px; background: #fff;
}
.select:focus { outline: none; border-color: #2196F3; }

/* ─── Option chips (mirrors app box) ─── */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    height: 36px; min-width: 60px; padding: 0 16px; border: none; cursor: pointer;
    background: #b3e5fc; color: #fff; border-radius: 15px;
    font-size: 13px; font-weight: 700; box-shadow: 0 3px 6px rgba(0,0,0,.15);
    transition: .18s;
}
.chip:hover { background: #7B42F6; }
.chip-on { background: #7B42F6; }

/* ─── Amount field (mirrors app input card) ─── */
.field-pill {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid #ddd; border-radius: 20px;
    padding: 0 16px; margin-top: 8px;
    transition: .2s;
}
.field-pill:focus-within { border-color: #2196F3; box-shadow: 0 0 0 3px rgba(33,150,243,.15); }
.field-pill span { font-weight: 800; font-size: 15px; color: #1f2937; }
.field-pill input { border: none; box-shadow: none; padding: 12px 0; background: transparent; width: 100%; }
.field-pill input:focus { box-shadow: none; }

.errtxt { color: #dc2626; font-size: 13px; font-weight: 600; margin-top: 6px; }

/* ─── Result box (mirrors app result card) ─── */
.result-box {
    background: #fff; border-radius: 25px; padding: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12); margin: 18px 0 14px;
}
.r-big { font-size: 29px; color: #7B42F6; font-weight: 800; text-align: center; margin-bottom: 8px; }
.r-line { text-align: center; font-size: 19px; padding: 2px 0; }
.r-line small { font-size: 14px; color: #666; }
.r-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.r-row b { color: #7B42F6; }

/* ─── Invest Now (mirrors app gradient button) ─── */
.invest-btn {
    width: 220px; max-width: 100%; height: 46px; margin: 4px auto 8px;
    display: block; border: none; border-radius: 40px;
    background: linear-gradient(90deg, #7B42F6, #9D5CFF);
    color: #fff; font-size: 20px; font-weight: 800; cursor: pointer;
    box-shadow: 0 6px 14px rgba(123,66,246,.4);
    transition: .15s;
}
.invest-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(123,66,246,.5); }

.btn-lg { padding: 14px; font-size: 18px; font-weight: 800; border-radius: 40px; }

/* ─── Misc shared ─── */
.note { color: #666; font-size: 14px; }
.info-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15px; }
.info-row .label { color: #666; }
.info-row .value { font-weight: 600; color: #333; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; display: inline-block; }
.badge-green { background: #22c55e; }
.badge-red { background: #dc2626; }
.badge-orange { background: #f59e0b; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-box { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 4px 18px rgba(0,0,0,.08); text-align: center; }
.stat-box .num { font-size: 28px; font-weight: 700; color: #2196F3; }
.stat-box .lbl { font-size: 13px; color: #666; margin-top: 4px; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; }
.pill-green { background: #22c55e; }
.pill-red { background: #dc2626; }
.pill-orange { background: #f59e0b; }

.status-card .status-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn-sm { padding: 8px 14px; font-size: 13px; }

.code-chip {
    display: inline-block; background: #eff6ff; color: #1d4ed8;
    border: 1.5px dashed #93c5fd; border-radius: 10px;
    padding: 10px 18px; font-size: 18px; font-weight: 700;
    letter-spacing: 1px; margin-bottom: 14px;
}
.share-box textarea {
    width: 100%; padding: 12px; border: 1.5px solid #ddd;
    border-radius: 8px; font-size: 14px; font-family: inherit;
    background: #fafafa; margin-bottom: 12px; resize: vertical;
}
.share-box .note { margin-left: 10px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; background: #f3f4f6; color: #374151; padding: 10px 12px; font-size: 13px; }
.table td { padding: 10px 12px; border-bottom: 1px solid #eee; color: #333; }
.table tbody tr:hover { background: #fafbfc; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.member-card { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.06); text-align: center; }
.avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #2196F3, #7B42F6);
    color: #fff; font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
}
.m-name { font-weight: 700; color: #1f2937; font-size: 15px; }
.m-sub { color: #666; font-size: 13px; margin-top: 2px; }
.m-tags { margin: 10px 0; }
.mini-tag { display: inline-block; background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 3px 10px; margin: 2px; }
.m-date { color: #9ca3af; font-size: 12px; }

.form-card { max-width: 460px; }
.hr { border: none; border-top: 1px solid #eee; margin: 18px 0; }

.member-card .m-actions { display: flex; gap: 8px; margin-top: 12px; }
.member-card .btn { flex: 1; padding: 8px 6px; font-size: 13px; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }