/* ============================================================
   HornetPath - Complete CSS Stylesheet
   Dark theme cybersecurity mentoring platform
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --primary: #F59E0B;
    --primary-hover: #D97706;
    --primary-light: #FCD34D;
    --primary-dim: rgba(245, 158, 11, 0.15);
    --dark-bg: #1a1a2e;
    --card-bg: #16213e;
    --accent-dark: #0f3460;
    --surface: #1e2a47;
    --surface-hover: #243352;
    --success: #22C55E;
    --success-dim: rgba(34, 197, 94, 0.15);
    --blue: #3B82F6;
    --blue-dim: rgba(59, 130, 246, 0.15);
    --red: #EF4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --purple: #8B5CF6;
    --purple-dim: rgba(139, 92, 246, 0.15);
    --warning: #F59E0B;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --text: #E5E7EB;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
    --border: #374151;
    --border-light: #4B5563;
    --nav-height: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --transition: 200ms ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--dark-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Global honeycomb background (login aesthetic everywhere) --- */
.global-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
.global-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(15, 52, 96, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}
.global-bg .honeycomb-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23F59E0B' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%23F59E0B' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: visible;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.nav-brand:hover {
    color: var(--primary-light) !important;
}

.nav-brand-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user-icon {
    color: var(--primary);
    font-size: 0.75rem;
}

.nav-link {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text) !important;
    background: var(--surface);
}

.nav-link-logout {
    color: var(--red) !important;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.nav-link-logout:hover {
    background: var(--red-dim);
    color: var(--red) !important;
}

/* Nav dropdown (multi-ruche selector) */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted) !important;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-dropdown-trigger:hover {
    color: var(--text) !important;
    background: var(--surface);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background var(--transition);
}
.nav-dropdown-item:hover {
    background: var(--surface);
    color: var(--primary);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    padding-top: calc(var(--nav-height) + 24px);
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

.main-content-full {
    padding-top: 0;
    max-width: none;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.alert-danger {
    background: var(--red-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.alert-success {
    background: var(--success-dim);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86EFAC;
}

.alert-warning {
    background: var(--warning-dim);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--text);
    transition: all var(--transition);
    font-family: var(--font);
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-input-sm {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

/* Hide native select when custom dropdown is active */
select.form-input,
select.form-input-sm {
    display: none;
}

/* Custom dropdown component */
.hp-select {
    position: relative;
    display: inline-block;
}

.hp-select-trigger {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 32px 10px 14px;
    font-size: 0.9375rem;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    width: 100%;
    position: relative;
}

.hp-select-trigger::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--primary);
    transition: transform var(--transition);
}

.hp-select.open .hp-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.hp-select-trigger:hover,
.hp-select.open .hp-select-trigger {
    border-color: var(--primary);
}

.hp-select.open .hp-select-trigger {
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Small variant */
.hp-select-sm .hp-select-trigger {
    padding: 6px 28px 6px 10px;
    font-size: 0.8125rem;
}

/* Dropdown menu */
.hp-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.hp-select.open .hp-select-menu {
    display: block;
}

.hp-select-option {
    padding: 8px 14px;
    font-size: inherit;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-select-sm .hp-select-option {
    padding: 6px 10px;
    font-size: 0.8125rem;
}

.hp-select-option:hover,
.hp-select-option.focused {
    background: var(--surface-hover);
}

.hp-select-option.selected {
    background: var(--primary-dim);
    color: var(--primary);
}

.hp-select-option + .hp-select-option {
    border-top: 1px solid rgba(55, 65, 81, 0.4);
}

/* Scrollbar for dropdown */
.hp-select-menu::-webkit-scrollbar {
    width: 6px;
}
.hp-select-menu::-webkit-scrollbar-track {
    background: transparent;
}
.hp-select-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.hp-select-menu::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Disabled states */
.hp-select-disabled .hp-select-trigger {
    opacity: 0.5;
    cursor: not-allowed;
}
.hp-select-disabled .hp-select-trigger::after {
    border-top-color: var(--text-dim);
}
.hp-select-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Upward dropdown (for toolbars near top of page) */
.hp-select-up .hp-select-menu {
    top: auto;
    bottom: calc(100% + 4px);
}
.hp-select-up .hp-select-trigger::after {
    border-top: none;
    border-bottom: 5px solid var(--primary);
}
.hp-select-up.open .hp-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.form-input-color {
    height: 42px;
    cursor: pointer;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-input-color-sm {
    height: 32px;
    width: 40px;
    cursor: pointer;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Rank management rows */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 620px;
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.rank-row:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-dim);
}

.rank-row-color {
    width: 28px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
}

.rank-row-hex {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.rank-row-name {
    width: 120px;
    flex-shrink: 0;
}

.rank-row-at {
    color: var(--text-dim);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.rank-row-threshold {
    width: 56px;
    text-align: center;
    flex-shrink: 0;
    -moz-appearance: textfield;
}
.rank-row-threshold::-webkit-inner-spin-button,
.rank-row-threshold::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rank-row-pct {
    color: var(--text-dim);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rank-row-delete {
    display: inline;
    margin-left: -6px;
    margin-top: -4px;
}

.rank-row-move {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
}
.rank-row-move button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.6rem;
    padding: 0 4px;
    line-height: 1;
}
.rank-row-move button:hover {
    color: var(--primary);
}

.form-textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--text);
    transition: all var(--transition);
    font-family: var(--font);
    resize: vertical;
    width: 100%;
    min-height: 80px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-textarea::placeholder {
    color: var(--text-dim);
}

.form-textarea-sm {
    padding: 6px 10px;
    font-size: 0.8125rem;
    min-height: 48px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group-half {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: #1a1a2e;
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #1a1a2e;
}

.btn-success {
    background: var(--success);
    color: #1a1a2e;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #16A34A;
    border-color: #16A34A;
    color: #1a1a2e;
}

.btn-blue {
    background: var(--blue-dim);
    color: var(--blue);
    border-color: var(--blue);
}

.btn-blue:hover:not(:disabled) {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

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

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    border-color: #DC2626;
}

.btn-warning {
    background: var(--warning);
    color: #1a1a2e;
    border-color: var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #1a1a2e;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn-hex-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 0.6875rem;
}

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

.badge-muted {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.badge-role {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.625rem;
    gap: 2px;
    border: 1px solid transparent;
}

.badge-admin {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.10));
    color: #FBBF24;
    border-color: rgba(251, 191, 36, 0.3);
}

.badge-sentinelle {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(167, 139, 250, 0.10));
    color: #A78BFA;
    border-color: rgba(139, 92, 246, 0.3);
}

.badge-eclaireur {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(96, 165, 250, 0.10));
    color: #60A5FA;
    border-color: rgba(59, 130, 246, 0.3);
}

/* Status badges */
.badge-status-locked {
    background: rgba(107, 114, 128, 0.2);
    color: #9CA3AF;
}

.badge-status-available {
    background: var(--blue-dim);
    color: var(--blue);
}

.badge-status-in_progress {
    background: var(--purple-dim);
    color: var(--purple);
}

.badge-status-submitted, .badge-status-pending {
    background: rgba(251, 146, 60, 0.15);
    color: #FB923C;
}

.badge-status-mastered, .badge-status-approved {
    background: var(--success-dim);
    color: var(--success);
}

.badge-status-rejected {
    background: var(--red-dim);
    color: var(--red);
}

.badge-status-revision {
    background: rgba(251, 146, 60, 0.15);
    color: #FB923C;
}

.badge-zone {
    font-size: 0.75rem;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-hex {
    color: var(--primary);
    font-size: 1.5rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.9375rem;
}

.dashboard-header-gamified {
    display: flex;
    align-items: center;
    gap: 24px;
}

.dashboard-header-text {
    flex: 1;
}

.dashboard-rank {
    flex-shrink: 0;
}

.rank-hex-wrapper {
    filter: drop-shadow(0 0 3px currentColor);
}

.rank-hex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: color-mix(in srgb, currentColor 15%, transparent);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.rank-hex-icon {
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
}

.rank-label {
    color: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.points-display {
    color: var(--primary);
    font-weight: 700;
}

.points-value {
    font-size: 1.1rem;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stats-row-eclaireur {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.stat-card-primary::before { background: var(--primary); }
.stat-card-success::before { background: var(--success); }
.stat-card-blue::before { background: var(--blue); }
.stat-card-purple::before { background: var(--purple); }
.stat-card-warning::before { background: var(--warning); }

.stat-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    color: inherit !important;
    text-decoration: none;
    width: 100%;
}

.stat-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.stat-card-primary .stat-card-icon { color: var(--primary); }
.stat-card-success .stat-card-icon { color: var(--success); }
.stat-card-blue .stat-card-icon { color: var(--blue); }
.stat-card-purple .stat-card-icon { color: var(--purple); }
.stat-card-warning .stat-card-icon { color: var(--warning); }

.stat-card-content {
    flex: 1;
}

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

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.dashboard-section {
    margin-bottom: 32px;
}

.dashboard-section-wide {
    grid-column: 1;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

/* Tree Cards */
.tree-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.tree-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.tree-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-dim);
    transform: translateY(-2px);
}

.tree-card-link {
    display: block;
    color: inherit !important;
    text-decoration: none;
}

.tree-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tree-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
}

.tree-card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tree-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.tree-stat {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.tree-stat-value {
    font-weight: 700;
    color: var(--primary);
}

.tree-card-actions {
    display: flex;
    gap: 8px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

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

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 8px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.activity-actor {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

.activity-action {
    font-size: 0.6875rem;
}

.activity-detail {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 2px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.empty-state-large {
    padding: 64px 24px;
}

.empty-state-large h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin: 16px 0 8px;
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

/* ============================================================
   ZONE PROGRESS
   ============================================================ */
.zone-progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.zone-progress-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color var(--transition);
}

.zone-progress-item:hover {
    border-color: var(--primary);
}

.zone-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.zone-progress-title {
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-hex-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.zone-progress-count {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.progress-bar-wrapper {
    background: var(--surface);
    border-radius: 100px;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 0;
}

.progress-bar-text {
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

/* ============================================================
   RANKS DISPLAY
   ============================================================ */
.ranks-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.rank-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: all var(--transition);
    opacity: 0.4;
}

.rank-item:hover {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    opacity: 0.8;
}

.rank-item-active {
    opacity: 1;
    background: var(--primary-dim);
}

.rank-hex-small {
    font-size: 1.5rem;
    color: var(--text-dim);
    line-height: 1;
}

.rank-item-active .rank-hex-small {
    color: var(--primary);
}

.rank-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rank-item-active .rank-name {
    color: var(--primary);
}

.rank-item-passed {
    opacity: 0.5;
}

.rank-item-passed .rank-hex-small {
    color: var(--green);
}

.rank-connector {
    width: 32px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* ============================================================
   HEX GRID VIEW
   ============================================================ */
.hex-view-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.hex-toolbar-top {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: 48px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 300;
}

.hex-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hex-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hex-tree-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

#hex-container {
    position: absolute;
    top: calc(var(--nav-height) + 48px);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-bg);
    cursor: grab;
}

#hex-container:active {
    cursor: grabbing;
}

/* Legend */
.hex-legend {
    position: fixed;
    bottom: 16px;
    left: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    z-index: 99;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-height) - 96px);
    overflow-y: auto;
}

.hex-legend-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.hex-legend-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hex-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.hex-legend-swatch {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-legend-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font);
    margin-bottom: 0;
}

.hex-legend-toggle-icon {
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.hex-legend:not(.hex-legend-collapsed) .hex-legend-toggle-icon {
    transform: rotate(90deg);
}

.hex-legend:not(.hex-legend-collapsed) .hex-legend-toggle {
    margin-bottom: 10px;
}

.hex-legend-body {
    display: block;
}

.hex-legend-collapsed .hex-legend-body {
    display: none;
}

.hex-legend-collapsed {
    min-width: auto;
    padding: 10px 14px;
}

.hex-legend-locked { background: #374151; opacity: 0.6; }
.hex-legend-available { background: rgba(59, 130, 246, 0.45); }
.hex-legend-progress { background: rgba(139, 92, 246, 0.6); }
.hex-legend-submitted { background: rgba(245, 158, 11, 0.7); }
.hex-legend-mastered { background: rgba(34, 197, 94, 0.75); }

/* Side Panel */
.side-panel {
    position: fixed;
    top: calc(var(--nav-height) + 48px);
    right: 0;
    transform: translateX(100%);
    width: 400px;
    height: calc(100vh - var(--nav-height) - 48px);
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    z-index: 200;
    transition: transform 0.3s ease;
    will-change: transform;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.side-panel-open {
    transform: translateX(0);
}

.side-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 10;
}

.side-panel-close:hover {
    background: var(--red-dim);
    color: var(--red);
}

.side-panel-content {
    padding: 48px 20px 20px;
}

/* Hive Panel (inside side-panel) */
.hive-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hive-panel-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hive-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.hive-panel-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hive-panel-zone {
    margin-top: -8px;
}

.hive-panel-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.hive-panel-stats {
    display: flex;
    gap: 24px;
}

.hive-panel-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hive-panel-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

.hive-panel-subtitle {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.hive-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.learner-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.learner-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.learner-status-row:last-child {
    border-bottom: none;
}

.learner-status-name {
    font-size: 0.8125rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.learner-status-select {
    width: auto;
    min-width: 120px;
    font-size: 0.75rem;
    padding: 4px 8px;
}

.prereqs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prereq-badge, .prereq-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.prereq-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.prereq-hex {
    color: var(--primary);
    font-size: 0.625rem;
}

/* ============================================================
   EDITOR
   ============================================================ */
.editor-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.editor-toolbar {
    position: fixed;
    top: calc(var(--nav-height) + 48px);
    left: 0;
    width: 240px;
    height: calc(100vh - var(--nav-height) - 48px);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    z-index: 100;
    overflow-y: auto;
    padding: 16px;
    padding-right: 20px;
}

.editor-toolbar-resize {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s;
}

.editor-toolbar-resize:hover,
.editor-toolbar-resize.dragging {
    background: var(--primary);
    opacity: 0.5;
}

.editor-container #hex-container {
    left: 240px;
    right: 400px;
}

.toolbar-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toolbar-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.toolbar-section .hp-select,
.edit-add-form .hp-select,
.edit-form .hp-select {
    display: block;
    max-width: 100%;
}

.toolbar-section .hp-select-menu,
.edit-add-form .hp-select-menu,
.edit-form .hp-select-menu {
    max-width: 100%;
}

.toolbar-section .hp-select-option,
.edit-add-form .hp-select-option,
.edit-form .hp-select-option {
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-section:last-child {
    border-bottom: none;
}

.toolbar-subtitle {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.toolbar-modes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toolbar-mode-btn {
    text-align: left;
    justify-content: flex-start;
}

.toolbar-mode-btn.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

.toolbar-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 6px;
    line-height: 1.4;
}

.toolbar-selected-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

/* Edit Panel */
.edit-panel {
    position: fixed;
    top: calc(var(--nav-height) + 48px);
    right: -420px;
    width: 400px;
    height: calc(100vh - var(--nav-height) - 48px);
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    z-index: 200;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.edit-panel-open {
    right: 0;
}

.edit-panel-resize {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s;
}

.edit-panel-resize:hover,
.edit-panel-resize.dragging {
    background: var(--primary);
    opacity: 0.5;
}

.edit-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.edit-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.edit-panel-close {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.edit-panel-close:hover {
    background: var(--red-dim);
    color: var(--red);
}

.edit-panel-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    min-width: 0;
}

.edit-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.edit-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.edit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.edit-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.edit-list-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.edit-list-item-name {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.edit-list-item-detail {
    font-size: 0.7rem;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-list-item-detail a {
    color: var(--primary);
}

.edit-list-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.edit-list-item-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    transition: all var(--transition);
}

.edit-list-item-btn:hover {
    background: var(--red-dim);
    color: var(--red);
}

/* Inline edit/delete buttons – hexagonal outline */
.btn-edit-inline {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    color: var(--primary);
    transition: color var(--transition);
    z-index: 0;
}
.btn-delete-inline {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    color: var(--red);
    transition: color var(--transition);
    z-index: 0;
}

/* Border layer (hex outline) */
.btn-edit-inline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -2;
}
.btn-delete-inline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--red);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -2;
}

/* Fill layer (inner hex) */
.btn-edit-inline::after,
.btn-delete-inline::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--surface);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}

.btn-edit-inline:hover { color: var(--primary-light); }
.btn-edit-inline:hover::after { background: var(--primary-dim); }

.btn-delete-inline:hover { color: #FCA5A5; }
.btn-delete-inline:hover::after { background: var(--red-dim); }

/* Inline edit form (appears below item) */
.edit-list-item-wrapper {
    border-radius: var(--radius-sm);
}

.edit-inline-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px 10px;
    background: var(--surface-hover);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-top: 1px solid var(--border);
}

.edit-inline-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.edit-add-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Edit Panel Tabs */
.edit-panel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 0 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.edit-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.7rem;
    padding: 5px 9px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.edit-tab:hover {
    color: var(--text);
    background: var(--surface);
}

.edit-tab.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.edit-tab-content {
    display: none;
}

.edit-tab-content.active {
    display: block;
}

/* ============================================================
   HIVE DETAIL PAGE
   ============================================================ */
.hive-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.hive-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.hive-detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hive-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.hive-detail-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hive-detail-header-right {
    flex-shrink: 0;
    margin-top: 8px;
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: var(--font);
}

.tab-btn:hover {
    color: var(--text);
    background: var(--surface);
}

.tab-btn-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 100px;
    margin-left: 4px;
}

.tab-btn-active .tab-count {
    background: var(--primary-dim);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content-active {
    display: block;
}

.tab-panels {
    min-height: 400px;
}

/* Description Tab */
.hive-description {
    margin-bottom: 24px;
}

.description-text {
    color: var(--text);
    line-height: 1.8;
    font-size: 0.9375rem;
}

.hornet-links-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.hornet-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hornet-link-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.hornet-link-icon {
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.hornet-link-content {
    flex: 1;
}

.hornet-link-content strong {
    color: var(--text);
}

.hornet-link-target {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-left: 6px;
}

.hornet-link-note {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 4px;
}

.prereqs-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Exercises Tab */
.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.exercise-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.exercise-order {
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}

.exercise-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.exercise-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.exercise-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Resources Tab */
.resources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.resource-type-badge {
    margin-bottom: 6px;
}

.resource-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.resource-link {
    color: var(--blue) !important;
}

.resource-link:hover {
    color: #60A5FA !important;
}

.resource-description {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================================
   SUBMISSIONS
   ============================================================ */
.submissions-queue {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.submission-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.submission-card-pending {
    border-left: 3px solid var(--primary);
}

.submission-card-approved {
    border-left: 3px solid var(--success);
}

.submission-card-rejected {
    border-left: 3px solid var(--red);
}

.submission-card-revision {
    border-left: 3px solid #FB923C;
}

.submission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.submission-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.submission-card-title {
    font-size: 1rem;
    font-weight: 700;
}

.submission-card-title a {
    color: var(--text) !important;
}

.submission-card-title a:hover {
    color: var(--primary) !important;
}

.submission-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.submission-author {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.submission-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.submission-exercise {
    font-size: 0.6875rem;
}

.submission-card-body {
    padding: 16px 20px;
}

.submission-content {
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.submission-link {
    margin-top: 8px;
}

.submission-link-btn {
    font-size: 0.8125rem;
}

.submission-card-review {
    padding: 16px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.submission-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.submission-review-inline {
    padding: 16px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.submission-feedback {
    padding: 12px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.submission-feedback-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.submission-reviewer {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
    display: block;
}

.review-result {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-result p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Submission form */
.submission-form-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.submission-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.submissions-list-section {
    margin-top: 8px;
}

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

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-form-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar-hex {
    color: var(--primary);
    font-size: 1.25rem;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.comment-content {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================================
   HISTORY
   ============================================================ */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 20px;
}

.history-item {
    position: relative;
    padding: 12px 0 12px 24px;
    border-left: 2px solid var(--border);
}

.history-item:last-child {
    border-left-color: transparent;
}

.history-dot {
    position: absolute;
    left: -6px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card-bg);
}

.history-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-actor {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-left: auto;
}

.history-detail {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 4px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-section {
    margin-bottom: 32px;
}

.admin-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .admin-columns {
        grid-template-columns: 1fr;
    }
}

/* Ruche cards with assignment */
.ruche-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: visible;
    animation: fadeIn 0.3s ease forwards;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.ruche-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-dim);
}

.ruche-card-main {
    padding: 20px;
}

.ruche-card-assign {
    padding: 16px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: relative;
    z-index: 10;
}

.assign-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.assign-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.assign-item:hover {
    border-color: var(--primary);
}

.assign-item-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.assign-hex {
    color: var(--primary);
    margin-right: 4px;
}

.assign-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.assign-form .form-input {
    flex: 1;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 12px 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
}

.admin-table tbody tr:hover {
    background: var(--surface);
}

.admin-table-user {
    font-weight: 600;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-help-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.breadcrumb-link {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
}

.breadcrumb-link:hover {
    color: var(--primary) !important;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border: none;
}

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

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-danger {
    color: var(--red);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

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

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

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

    .dashboard-section-wide {
        grid-column: auto;
    }

    .editor-toolbar {
        width: 200px;
    }

    .editor-container #hex-container {
        left: 200px;
    }

    .edit-panel {
        width: 340px;
    }

    .side-panel {
        width: 340px;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0 12px;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-user {
        display: none;
    }

    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }

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

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

    .tree-list {
        grid-template-columns: 1fr;
    }

    .dashboard-header-gamified {
        flex-direction: column;
        text-align: center;
    }

    .ranks-display {
        flex-wrap: wrap;
        justify-content: center;
    }

    .rank-connector {
        display: none;
    }

    .hive-detail-header {
        flex-direction: column;
        gap: 12px;
    }

    .tab-nav {
        gap: 0;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }

    .editor-toolbar {
        display: none;
    }

    .editor-container #hex-container {
        left: 0;
        right: 0;
    }

    .edit-panel, .side-panel {
        width: 100%;
        right: 0;
        transform: translateX(100%);
    }

    .edit-panel-open, .side-panel-open {
        transform: translateX(0);
    }

    .hex-legend {
        display: none;
    }

    .submission-card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .submission-actions {
        flex-direction: column;
    }

    .submission-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

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

    .login-card {
        padding: 32px 24px;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .tree-card, .submission-card, .exercise-card, .resource-card {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.badge-status-in_progress {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================================
   Custom Modal (replaces native confirm/alert)
   ============================================================ */
.hp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 25, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.hp-modal-overlay.hp-modal-open {
    display: flex;
}

.hp-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 158, 11, 0.08);
    text-align: center;
    transform: scale(0.92);
    transition: transform 200ms ease;
}

.hp-modal-open .hp-modal {
    transform: scale(1);
}

.hp-modal-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
    opacity: 0.7;
}

.hp-modal-msg {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.hp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.hp-modal-actions .btn {
    min-width: 90px;
}
