/* ===== Variables ===== */
:root {
    --primary: #d97706;
    --primary-dark: #b45309;
    --primary-light: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Login Screen ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a2744 100%);
    padding: 1rem;
}

.login-box {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    display: inline-flex;
    margin-bottom: 0.75rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-logo .subtitle {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.error-text {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-align: center;
}

/* ===== App Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon.small svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .brand {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-text .portal-type {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 1rem 1rem 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    margin: 0.125rem 0.5rem;
    border-radius: 0.5rem;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.logout-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: var(--bg-hover);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    background: var(--bg-dark);
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.stat-card.large {
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.leagues {
    background: rgba(217, 119, 6, 0.15);
    color: var(--primary);
}

.stat-icon.players {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.stat-icon.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-icon.questions {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.stat-icon.scenarios {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Content Section ===== */
.content-section {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===== Activity Feed ===== */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Filters Bar ===== */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ===== Leagues Grid ===== */
.leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.league-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: border-color 0.2s;
    cursor: pointer;
}

.league-card:hover {
    border-color: var(--primary);
}

.league-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.league-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.league-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.health-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    min-width: 50px;
}

.health-score.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.health-score.yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.health-score.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.health-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.health-label {
    font-size: 0.625rem;
    text-transform: uppercase;
}

.league-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.league-stat {
    text-align: center;
}

.league-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.league-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.league-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.league-admin {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.league-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.league-status.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.league-status.trial {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.league-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* ===== Table Container ===== */
.table-container {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-hover);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* ===== Videos Grid ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.video-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.video-thumbnail {
    aspect-ratio: 16/9;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.video-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Assets Grid ===== */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.asset-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    text-align: center;
}

.asset-image {
    aspect-ratio: 1;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-image svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.asset-info {
    padding: 1rem;
}

.asset-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.asset-cost {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.asset-type {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ===== Field View ===== */
.field-view {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.field-diagram {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 2rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#field-svg {
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 400px;
}

.positions-sidebar {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.positions-sidebar p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Settings ===== */
.settings-section {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.settings-form {
    max-width: 600px;
}

/* ===== Toggle Switch ===== */
.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 0.5rem;
}

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.slider {
    background-color: var(--primary);
}

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

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* ===== Analytics ===== */
.analytics-stats .stat-card {
    flex-direction: column;
    text-align: center;
}

.retention-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.retention-card {
    background: var(--bg-dark);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.retention-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.retention-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feature-usage-list,
.accuracy-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item,
.accuracy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: 0.5rem;
}

.feature-name,
.accuracy-topic {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.feature-usage,
.accuracy-rate {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
}

.pagination button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ===== Loading State ===== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ===== League Detail View ===== */
.league-detail-view {
    max-height: 70vh;
    overflow-y: auto;
}

.league-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.league-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.league-type {
    color: var(--text-muted);
    text-transform: capitalize;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.admin-info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-info-card div {
    color: var(--text-secondary);
}

.admin-info-card strong {
    color: var(--text-primary);
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.usage-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.usage-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.usage-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.division-section {
    margin-bottom: 1.25rem;
}

.division-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.team-card-mini {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.team-card-mini .team-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.team-card-mini .team-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.data-table.compact {
    font-size: 0.875rem;
}

.data-table.compact th,
.data-table.compact td {
    padding: 0.5rem 0.75rem;
}

.more-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Collapsible sections */
.collapsible h3 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: -0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.collapsible h3:hover {
    background: var(--bg-hover);
}

.collapsible .chevron {
    transition: transform 0.2s;
}

.collapsible.collapsed .chevron {
    transform: rotate(-90deg);
}

.collapsible.collapsed .section-content {
    display: none;
}

/* ===== Coming Soon Placeholders ===== */
.coming-soon {
    text-align: center;
    padding: 2rem;
    background: var(--bg-hover);
    border-radius: 0.5rem;
    border: 1px dashed var(--border-color);
}

.coming-soon-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.coming-soon p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ===== Admin Forms ===== */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.form-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group label .required {
    color: var(--error);
}

.form-group input,
.form-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group .btn-sm {
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    width: fit-content;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Success message */
.success-message {
    text-align: center;
    padding: 1rem;
}

.success-message h3 {
    color: var(--success);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.credentials-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1rem;
}

.credentials-box h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.credentials-box p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.credentials-box .note {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--warning);
    font-size: 0.75rem;
}

.login-url {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-url code {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

/* Page header with button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header .btn {
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .field-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .usage-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .retention-grid {
        grid-template-columns: 1fr;
    }
}