:root[data-theme="dark"] {
  --bg: #090d16;
  --sidebar: rgba(14, 20, 31, 0.85);
  --card: rgba(20, 27, 41, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #dc2626;
  --primary-hover: #ef4444;
  --primary-glow: rgba(220, 38, 38, 0.35);
  --border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(10, 15, 25, 0.6);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --sidebar: rgba(255, 255, 255, 0.95);
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-glow: rgba(220, 38, 38, 0.15);
  --border: rgba(15, 23, 42, 0.1);
  --input-bg: #f1f5f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; min-height: 100vh; }

.login-overlay { position: fixed; inset: 0; background: radial-gradient(circle at 50% 20%, #2b0b0e 0%, #090d16 80%); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9999; }
.login-card { background: rgba(20, 27, 41, 0.85); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px; padding: 40px 32px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5); }
.brand-circle-badge { width: 50px; height: 50px; border-radius: 50%; background: #fff; border: 3.5px solid #dc2626; display: grid; place-items: center; font-weight: 850; font-size: 26px; color: #dc2626; margin: 0 auto 16px; box-shadow: 0 4px 16px var(--primary-glow); }
.brand-circle-badge.sm { width: 36px; height: 36px; font-size: 19px; border-width: 2.5px; margin: 0; }
.brand-badge { font-size: 10px; font-weight: 800; color: #dc2626; text-transform: uppercase; letter-spacing: 0.12em; }
.login-titles h2 { font-size: 21px; font-weight: 800; margin: 6px 0; }
.login-titles p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 24px; }
.auth-error-box { background: rgba(239, 68, 68, 0.15); border: 1px solid #ef4444; color: #fca5a5; padding: 12px; border-radius: 10px; font-size: 13px; margin-top: 18px; font-weight: 600; }

.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 270px; background: var(--sidebar); backdrop-filter: blur(16px); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 100; }
.sidebar-header { padding: 22px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.sidebar-brand-title { font-size: 14px; font-weight: 800; }
.sidebar-brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.user-profile-badge { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user-role-tag { font-size: 10.5px; font-weight: 800; color: #dc2626; text-transform: uppercase; }

.sidebar-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: transparent; border: none; color: var(--text-muted); border-radius: 12px; cursor: pointer; font-size: 13.5px; font-weight: 700; font-family: inherit; width: 100%; text-align: left; transition: all 0.2s ease; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-item.active { background: rgba(220, 38, 38, 0.15); color: #fff; border-left: 3px solid var(--primary); }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.action-btn { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.logout-btn { color: #ef4444; }

.main-content { margin-left: 270px; flex: 1; padding: 30px 36px; display: flex; flex-direction: column; }
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.top-nav h1 { font-size: 22px; font-weight: 850; letter-spacing: -0.02em; }
.top-nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-refresh { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.team-card { background: var(--card); backdrop-filter: blur(16px); border: 1px solid var(--card-border); border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); }
.team-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.team-card-title { font-size: 17px; font-weight: 800; color: var(--text); }
.team-card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.team-roles-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chip { font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.06); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); }
.role-chip.lead { background: rgba(220, 38, 38, 0.15); border-color: rgba(220, 38, 38, 0.35); color: #fca5a5; }

.content-card { background: var(--card); backdrop-filter: blur(16px); border: 1px solid var(--card-border); border-radius: 20px; padding: 26px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.data-table th { padding: 12px 14px; font-weight: 800; font-size: 11.5px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.role-badge { display: inline-block; font-size: 11.5px; font-weight: 800; background: rgba(220, 38, 38, 0.15); color: #f87171; padding: 3px 10px; border-radius: 8px; }
.btn-remove { background: none; border: none; color: #ef4444; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-remove:hover { text-decoration: underline; }

.hero-tag { font-size: 11px; font-weight: 800; background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); padding: 4px 10px; border-radius: 100px; }
.border-red { border: 1px solid rgba(220, 38, 38, 0.3); }
.admin-shield-header { display: flex; align-items: center; gap: 14px; font-size: 26px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 999; }
.modal-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 22px; padding: 30px; width: 100%; max-width: 480px; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5); }
.modal-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
input[type="text"], input[type="email"], select { width: 100%; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: 12px; font-size: 14px; outline: none; font-family: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; font-size: 13.5px; font-weight: 700; border-radius: 12px; border: none; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) { .sidebar { width: 220px; } .main-content { margin-left: 220px; padding: 20px; } }
