* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Light.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-Bold.ttf') format('truetype');
    font-weight: 700;
}

:root {
    --bg: #ffffff;
    --surface: #f7f7f7;
    --surface-2: #fbfbfb;
    --text: #111111;
    --muted: #999999;
    --soft: #cccccc;
    --line: rgba(0,0,0,0.06);
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #c62828;
    --danger-bg: #fde8e8;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-pill: 999px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-logo .big { color: #111111; }
.nav-logo .bite { color: rgba(0,0,0,0.25); font-weight: 400; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    background: #111111;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    margin-left: 10px;
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link,
.btn-secondary,
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.nav-link,
.btn-ghost {
    color: #777777;
    background: transparent;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active,
.btn-ghost:hover {
    background: #f4f4f4;
    color: #111111;
}

.btn-primary {
    padding: 12px 22px;
    background: #111111;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
}

.btn-primary:hover {
    background: #333333;
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 12px 22px;
    background: #f4f4f4;
    color: #111111;
    font-size: 0.92rem;
    font-weight: 700;
}

.btn-secondary:hover,
.btn-ghost:hover {
    background: #ececec;
}

.btn-danger {
    padding: 12px 22px;
    background: #b42318;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
}

.btn-danger:hover {
    background: #8f1d14;
    transform: translateY(-1px);
}

.page-shell {
    padding: 108px 40px 56px;
}

.hero {
    max-width: 1280px;
    margin: 0 auto 28px;
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.hero-panel,
.account-card,
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
}

.hero-panel {
    padding: 36px;
}

.hero-eyebrow,
.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--soft);
    margin-bottom: 18px;
    display: block;
}

.hero-title,
.section-title {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    font-weight: 700;
    color: #111111;
}

.hero-subtitle,
.section-desc {
    margin-top: 18px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 620px;
}

.hero-meta {
    margin-top: 26px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    color: #666666;
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-side {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-summary {
    display: flex;
    gap: 18px;
    align-items: center;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: #ffffff;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-fallback {
    font-size: 2rem;
    font-weight: 700;
    color: #111111;
}

.profile-summary h2 {
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-summary p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

.score-wrap {
    background: #ffffff;
    border-radius: 24px;
    padding: 18px 20px;
}

.score-label {
    color: var(--soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.score-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.score-value {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
}

.score-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.progress {
    margin-top: 14px;
    height: 10px;
    background: #ececec;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: #111111;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.stats-grid {
    max-width: 1280px;
    margin: 0 auto 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    padding: 24px 24px 26px;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--soft);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #111111;
    line-height: 1;
}

.stat-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.main-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.account-card {
    padding: 28px;
}

.account-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.account-card p.card-copy {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.65;
    margin-bottom: 22px;
}

.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.field,
.field-full {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

.field label,
.field-full label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--soft);
}

.input,
.textarea,
.select {
    width: 100%;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 14px 16px;
    color: #111111;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 44px;
    background-image:
        linear-gradient(45deg, transparent 50%, #777777 50%),
        linear-gradient(135deg, #777777 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.inline-input-row {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 10px;
}

.prefix-select {
    min-width: 120px;
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: rgba(0,0,0,0.12);
}

.readonly {
    color: #777777;
    background: #fbfbfb;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    background: #ffffff;
}

.toggle-copy strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
}

.toggle-copy span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.switch {
    position: relative;
    width: 54px;
    height: 32px;
    flex-shrink: 0;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #e4e4e4;
    border-radius: 999px;
    transition: background 0.18s ease;
}

.slider::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.18s ease;
}

.switch input:checked + .slider {
    background: #111111;
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

.list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    background: #ffffff;
}

.group-header-row {
    border: 1px solid rgba(17, 17, 17, 0.06);
    box-shadow: 0 10px 28px rgba(17, 17, 17, 0.06);
}

.group-member-row {
    border: 1px solid rgba(17, 17, 17, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.group-member-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
}

.group-admin-note {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px dashed rgba(17, 17, 17, 0.14);
}

.list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #f2f2f2;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-main {
    min-width: 0;
    flex: 1;
}

.list-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
    line-height: 1.35;
}

.list-subtitle {
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
}

.list-value {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
}

.twofa-code-row {
    margin-top: 6px;
}

#twofaCodeValue {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.14em;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-neutral {
    background: #efefef;
    color: #777777;
}

.verification-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.verification-item {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px;
}

.verification-item strong {
    display: block;
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.verification-item p {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

.inline-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.inline-metric {
    background: #ffffff;
    border-radius: 20px;
    padding: 18px;
}

.inline-metric strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.inline-metric span {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    background: #111111;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 18px;
    min-width: 240px;
    max-width: 360px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #8a1f1f;
}

.empty-state {
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    color: var(--muted);
    line-height: 1.6;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.danger-card {
    border: 1px solid rgba(180, 35, 24, 0.15);
    background: linear-gradient(180deg, #fff6f5 0%, #fff 100%);
}

.input-danger {
    border: 1px solid rgba(180, 35, 24, 0.2);
}

.input-danger:focus {
    border-color: rgba(180, 35, 24, 0.45);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

/* ── Profile picture drop zone ─────────────────────────────────── */
.pic-drop-label-top {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--soft);
    display: block;
    margin-bottom: 10px;
}

.pic-drop-zone {
    position: relative;
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: 24px;
    background: #ffffff;
    min-height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.pic-drop-zone:hover,
.pic-drop-zone.drag-over {
    border-color: #111111;
    background: #fafafa;
}

.pic-drop-zone.has-preview {
    border-style: solid;
    border-color: rgba(0,0,0,0.06);
    min-height: 200px;
    cursor: default;
}

.group-pic-drop-zone {
    min-height: 132px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.group-pic-drop-zone.has-preview {
    min-height: 132px;
}

.group-pic-drop-zone.is-disabled {
    cursor: not-allowed;
    opacity: 0.72;
    filter: grayscale(0.18);
}

.group-pic-drop-zone.is-disabled .pic-browse-link {
    text-decoration: none;
}

.group-pic-preview {
    height: 132px;
    border-radius: 18px;
}

#groupAdminDescriptionInput {
    min-height: 96px;
}

.pic-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 24px;
    text-align: center;
    color: #aaaaaa;
    pointer-events: none;
    user-select: none;
}

.pic-drop-inner span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666666;
}

.pic-browse-link {
    color: #111111 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pic-drop-hint {
    font-size: 0.72rem !important;
    color: #cccccc !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pic-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 22px;
    display: none;
    pointer-events: none;
}

@media (max-width: 1180px) {
    .hero,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .main-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-8,
    .span-6,
    .span-4,
    .span-12 {
        grid-column: span 1;
    }
}

.tax-status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 4px;
}

.tax-status-checking  { background: #f5f5f5;  color: #666; }
.tax-status-connected { background: #dcfce7;  color: #16a34a; }
.tax-status-pending   { background: #fef9c3;  color: #a16207; }
.tax-status-missing   { background: #fde8e8;  color: #c62828; }

@media (max-width: 860px) {
    .nav {
        padding: 0 20px;
    }

    .nav-links {
        display: none;
    }

    .page-shell {
        padding: 96px 20px 40px;
    }

    .hero,
    .stats-grid,
    .main-grid,
    .form-grid,
    .verification-grid,
    .password-grid,
    .inline-metrics {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .account-card,
    .stat-card {
        padding: 24px;
    }
}
