/* IDMADDA Admin — Premium UI */
:root {
  --navy: #1a237e;
  --blue: #2196f3;
  --green: #2e7d32;
  --gold: #ffc107;
  --bg: #f0f4fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 270px;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(26, 35, 126, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 35, 126, 0.12);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); }

.admin-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 10% 10%, rgba(33,150,243,.12), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(26,35,126,.10), transparent 35%),
    var(--bg);
}

/* ——— Auth (login) ——— */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero {
  background: linear-gradient(145deg, #0d1547 0%, var(--navy) 40%, var(--blue) 100%);
  padding: 2rem 1.5rem 4rem; text-align: center; color: #fff; position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .5;
}
.auth-hero img { height: 72px; margin: 0 auto 12px; position: relative; }
.auth-hero h1 { margin: 0; font-size: 1.5rem; font-weight: 700; position: relative; }
.auth-hero p { margin: 6px 0 0; opacity: .85; font-size: .85rem; position: relative; }
.auth-card-wrap { flex: 1; margin-top: -2.5rem; padding: 0 1rem 1.5rem; display: flex; justify-content: center; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--card); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 1.75rem; align-self: flex-start;
}
.auth-card h2 { margin: 0 0 4px; color: var(--navy); font-size: 1.35rem; }
.auth-card .sub { color: var(--muted); font-size: .875rem; margin-bottom: 1.25rem; }
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input-wrap {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0 14px; background: #fafbfc; transition: .2s;
}
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,150,243,.15); background: #fff; }
.input-wrap svg { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.input-wrap input { flex: 1; border: none; background: transparent; padding: 12px 0; font-size: .95rem; outline: none; }
.btn-green {
  width: 100%; padding: 14px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #388e3c, var(--green)); color: #fff;
  font-weight: 700; font-size: .95rem; letter-spacing: .5px; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(46,125,50,.35); transition: transform .15s;
}
.btn-green:hover { transform: translateY(-1px); }
.btn-outline {
  width: 100%; padding: 13px; border: 2px solid var(--navy); border-radius: 12px;
  background: #fff; color: var(--navy); font-weight: 600; cursor: pointer; margin-top: 10px;
}
.auth-features {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 1.5rem; padding: 1rem;
  background: #f8fafc; border-radius: 14px; text-align: center;
}
.auth-features span { font-size: .65rem; color: var(--muted); display: block; margin-top: 4px; }
.feature-icon {
  width: 36px; height: 36px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; font-size: 1rem;
}

/* ——— Shell layout ——— */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: linear-gradient(180deg, #0f1654 0%, var(--navy) 100%);
  color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform .3s ease; box-shadow: 4px 0 24px rgba(0,0,0,.15);
}
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 12px; }
.sidebar-brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.sidebar-brand strong { display: block; font-size: .95rem; }
.sidebar-brand small { opacity: .7; font-size: .7rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 4px;
  border-radius: 12px; color: rgba(255,255,255,.75); text-decoration: none; font-size: .875rem; font-weight: 500;
  transition: .2s;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(33,150,243,.35); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.nav-link svg { width: 18px; height: 18px; opacity: .9; flex-shrink: 0; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .8rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), #64b5f6);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.admin-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.menu-btn {
  width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; display: grid; place-items: center;
}
.page-content { flex: 1; padding: 1.25rem 1.5rem 2rem; max-width: 1400px; width: 100%; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45; }
.sidebar-overlay.open { display: block; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .topbar { display: flex; }
}

/* ——— Page header ——— */
.page-hero {
  background: linear-gradient(135deg, var(--navy), var(--blue)); border-radius: var(--radius);
  padding: 1.5rem 1.75rem; color: #fff; margin-bottom: 1.25rem; box-shadow: var(--shadow-lg);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.page-hero h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.page-hero p { margin: 4px 0 0; opacity: .85; font-size: .875rem; }
.breadcrumb { font-size: .75rem; opacity: .7; margin-bottom: 4px; }

/* ——— KPI cards ——— */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-card {
  background: var(--card); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px;
  background: linear-gradient(135deg, transparent 50%, rgba(33,150,243,.08));
  border-radius: 0 0 0 100%;
}
.kpi-card .label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi-card .value { font-size: 1.75rem; font-weight: 800; color: var(--navy); margin-top: 4px; line-height: 1; }
.kpi-card .meta { font-size: .7rem; color: var(--muted); margin-top: 6px; }
.kpi-card.accent-green .value { color: var(--green); }
.kpi-card.accent-gold { border-color: #fde68a; background: linear-gradient(135deg, #fffbeb, #fff); }
.kpi-card.accent-gold .value { color: #b45309; }
.kpi-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 8px; font-size: 1.1rem;
}
.kpi-icon.blue { background: rgba(33,150,243,.12); color: var(--blue); }
.kpi-icon.green { background: rgba(46,125,50,.12); color: var(--green); }
.kpi-icon.gold { background: rgba(255,193,7,.2); color: #f59e0b; }
.kpi-icon.purple { background: rgba(124,58,237,.12); color: #7c3aed; }

/* ——— Panels ——— */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.panel {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h3 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--navy); }
.panel-body { padding: .5rem; }

/* ——— Badges ——— */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-royalty { background: #fef3c7; color: #92400e; }
.badge-root { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-inactive { background: #f1f5f9; color: #64748b; }

/* ——— Lists ——— */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: inherit; transition: .15s; margin-bottom: 4px;
}
.list-item:hover { background: #f1f5f9; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; font-size: .875rem; }
.list-item .sub { font-size: .75rem; color: var(--muted); }
.user-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}

/* ——— Tables ——— */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: .875rem; }
.data-table th {
  text-align: left; padding: 12px 16px; background: #f8fafc; color: var(--muted);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .actions a, .data-table .actions button {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px;
  font-size: .75rem; font-weight: 600; text-decoration: none; border: none; cursor: pointer;
}
.btn-view { background: rgba(33,150,243,.1); color: var(--blue); }
.btn-view:hover { background: rgba(33,150,243,.2); }

/* Mobile user cards */
.user-cards { display: none; gap: 12px; }
.user-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.user-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.user-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: .8rem; }
.user-card-meta div span { display: block; color: var(--muted); font-size: .7rem; }

@media (max-width: 768px) {
  .panel-grid { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .user-cards { display: grid; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 1rem; }
  .auth-features { grid-template-columns: repeat(3, 1fr); }
}

/* ——— Search bar ——— */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.search-bar input {
  flex: 1; min-width: 200px; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: .9rem; outline: none;
}
.search-bar input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,150,243,.12); }
.search-bar button {
  padding: 12px 24px; background: var(--navy); color: #fff; border: none; border-radius: 12px;
  font-weight: 600; cursor: pointer;
}

/* ——— Charts ——— */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 1rem 0; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar {
  width: 100%; max-width: 36px; background: linear-gradient(180deg, var(--blue), var(--navy));
  border-radius: 8px 8px 4px 4px; min-height: 8px; transition: height .5s ease;
}
.chart-bar-wrap span { font-size: .65rem; color: var(--muted); }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 1rem; font-size: .875rem; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
  background: linear-gradient(135deg, var(--green), #388e3c); color: #fff; border: none;
  border-radius: 12px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: .875rem;
}
.btn-ghost {
  padding: 10px 16px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: 10px; cursor: pointer; font-size: .8rem; width: 100%;
}

.stat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.stat-pill {
  padding: 8px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.stat-pill strong { color: var(--navy); }

/* Visible even if admin.js fails to load */
[data-animate] { opacity: 1; transform: none; }

/* ——— Settings panel ——— */
.settings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
.settings-nav {
  position: sticky; top: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem; box-shadow: var(--shadow);
}
.settings-nav-link {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; color: inherit; margin-bottom: 4px; transition: .15s;
}
.settings-nav-link:hover { background: #f1f5f9; }
.settings-nav-link strong { display: block; font-size: .8rem; color: var(--navy); }
.settings-nav-link small { display: block; font-size: .65rem; color: var(--muted); margin-top: 2px; }
.settings-nav-icon { font-size: 1.1rem; line-height: 1; margin-top: 2px; }
.settings-section { margin-bottom: 1.5rem; scroll-margin-top: 1rem; }
.settings-section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: .75rem; }
.settings-section-head h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.settings-section-head p { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.settings-section-icon { font-size: 1.5rem; }
.settings-fields { padding: 1rem; display: grid; gap: 12px; }
.setting-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; background: #fafbfc;
}
.setting-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.setting-card-head label { font-weight: 700; font-size: .9rem; color: var(--navy); }
.setting-suffix { font-size: .7rem; font-weight: 600; color: var(--blue); background: rgba(33,150,243,.1); padding: 3px 8px; border-radius: 999px; }
.setting-desc { margin: 0 0 10px; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.setting-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px;
  font-size: .95rem; font-weight: 600; color: var(--navy); background: #fff;
}
.setting-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,150,243,.12); }
.setting-input.readonly { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.setting-key { display: block; margin-top: 8px; font-size: .65rem; color: #94a3b8; }
.settings-save-bar {
  position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-lg); margin-bottom: 1.5rem;
}
.settings-save-bar p { margin: 0; font-size: .8rem; color: var(--muted); max-width: 480px; }
.settings-subtitle { margin: 0 0 4px; font-size: 1rem; color: var(--navy); }
.settings-hint { margin: 0 0 12px; font-size: .8rem; color: var(--muted); }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.settings-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setting-field label { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.setting-field input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: .9rem;
}
.admin-profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.admin-profile-item span { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.admin-profile-item strong { display: block; margin-top: 4px; font-size: .9rem; }

.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.filter-pill {
  padding: 8px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.filter-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.section-title { margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; color: var(--navy); }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .settings-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .settings-nav { grid-template-columns: 1fr; }
}

/* ——— User management ——— */
.users-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1rem; align-items: center; }
.toolbar-select {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px;
  font-size: .85rem; background: #fff; min-width: 140px;
}
.search-status { font-size: .75rem; color: var(--muted); white-space: nowrap; padding: 0 8px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-title { font-weight: 700; font-size: .875rem; }
.user-cell-sub { font-size: .75rem; color: var(--muted); }
.user-photo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.empty-hint { text-align: center; color: var(--muted); padding: 2rem; }

.detail-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
.detail-summary {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.detail-summary h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--navy); }
.detail-summary p { margin: 0; color: var(--muted); font-size: .875rem; }
.detail-summary-info { flex: 1; min-width: 200px; }
.detail-wallet-quick { display: flex; gap: 1.5rem; }
.detail-wallet-quick span { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; }
.detail-wallet-quick strong { font-size: 1.1rem; }
.detail-avatar-img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }

.detail-kv { padding: 1rem 1.25rem; display: grid; gap: 10px; }
.detail-kv div { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; }
.detail-kv span { color: var(--muted); }

.review-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 1rem; margin-bottom: 12px; background: #fafbfc;
}
.review-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.review-images { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.review-images a { text-align: center; text-decoration: none; color: var(--muted); font-size: .7rem; }
.review-images img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; margin-bottom: 4px; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 768px) {
  .review-actions { grid-template-columns: 1fr; }
  .users-toolbar { flex-direction: column; align-items: stretch; }
}

.upload-field { display: grid; gap: 6px; }
.upload-label { font-size: .8rem; font-weight: 600; color: var(--navy); }
.upload-hint { margin: 0; font-size: .75rem; color: var(--muted); line-height: 1.4; }
.upload-current { margin: 0; font-size: .8rem; color: var(--navy); word-break: break-all; }
.upload-current a { color: var(--primary); }
.upload-preview { max-width: 160px; max-height: 90px; border-radius: 10px; border: 1px solid var(--border); display: block; margin-top: 6px; }
.file-input { padding: 8px; cursor: pointer; background: #f8fafc; }

/* Team Reports */
.team-reports-wrap { display: grid; gap: 1rem; }
.team-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: .5rem; }
.team-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); color: #fff;
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.team-hero h2 { margin: 0 0 4px; font-size: 1.35rem; }
.team-hero p { margin: 0; opacity: .8; font-size: .875rem; }
.team-hero-main { display: flex; align-items: center; gap: 14px; }
.team-hero-avatar {
  width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.15);
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
}
.team-hero-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.team-stat span { display: block; font-size: .7rem; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.team-stat strong { font-size: 1.35rem; }
.level-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.level-card {
  text-align: left; background: var(--card); border: 2px solid var(--border); border-radius: 14px;
  padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.level-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.level-card.active { border-color: var(--primary); background: #f0f7ff; }
.level-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.level-badge { font-weight: 800; color: var(--navy); font-size: .9rem; }
.level-pct { font-size: .65rem; color: var(--muted); }
.level-card-count { font-size: 1.75rem; font-weight: 800; color: var(--navy); line-height: 1; }
.level-card-meta { display: flex; justify-content: space-between; font-size: .7rem; margin-top: 6px; }
.level-card-bar { height: 4px; background: #e2e8f0; border-radius: 4px; margin-top: 10px; overflow: hidden; }
.level-card-bar-fill { height: 100%; background: var(--green); border-radius: 4px; }
.level-count-badge {
  display: inline-block; background: var(--primary); color: #fff; font-size: .75rem;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}
.row-expand-btn {
  background: #f1f5f9; border: none; width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: .85rem; color: var(--navy);
}
.team-inline-detail { padding: 12px 8px; background: #f8fafc; border-radius: 12px; }
.detail-kv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px;
}
.detail-kv-grid div { font-size: .8rem; }
.detail-kv-grid span { display: block; color: var(--muted); font-size: .7rem; margin-bottom: 2px; }
.detail-kv-grid strong { color: var(--navy); word-break: break-word; }
.tree-view-body { padding: 1rem; overflow-x: auto; }
.tree-node { margin-left: calc(var(--depth, 0) * 20px); margin-bottom: 8px; }
.tree-node-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.tree-node-card strong { color: var(--navy); }
.tree-children { margin-top: 6px; border-left: 2px solid #e2e8f0; margin-left: 12px; padding-left: 8px; }
.modal-member-header { display: flex; gap: 14px; align-items: center; margin-bottom: 1.25rem; }
.modal-kv { margin-top: .5rem; }

/* Admin modal */
.admin-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.admin-modal[hidden] { display: none !important; }
.admin-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.admin-modal-card {
  position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,.2);
}
.admin-modal-lg { max-width: 640px; }
.admin-modal-head {
  display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.admin-modal-head h3 { margin: 0; font-size: 1rem; color: var(--navy); }
.admin-modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.admin-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 1rem 1.25rem; border-top: 1px solid var(--border);
}
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.btn-edit { background: #ede9fe; color: #5b21b6; padding: 6px 12px; border: none; border-radius: 8px; font-size: .75rem; font-weight: 600; cursor: pointer; }
.btn-edit:hover { background: #ddd6fe; }
.profile-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-edit-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 768px) {
  .profile-edit-grid { grid-template-columns: 1fr; }
  .team-hero-stats { gap: 1rem; }
}
