/* ============================================
   RIIONR - Sistema de Gamificação
   CSS Principal - Dark Theme
   ============================================ */

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

:root {
    --bg-primary: #0f0f13;
    --bg-secondary: #16161d;
    --bg-card: #1c1c27;
    --bg-card-hover: #22222f;
    --bg-input: #1a1a24;
    --bg-sidebar: #12121a;
    --border: #2a2a3a;
    --border-light: #333346;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #6a6a82;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --success: #2ecc71;
    --success-bg: rgba(46, 204, 113, 0.12);
    --danger: #e74c3c;
    --danger-bg: rgba(231, 76, 60, 0.12);
    --warning: #f39c12;
    --warning-bg: rgba(243, 156, 18, 0.12);
    --info: #3498db;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
    --transition: all 0.25s ease;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--accent-hover);
}

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    color: var(--text-primary);
    background: rgba(108, 92, 231, 0.08);
}

.sidebar-nav li.active a {
    color: var(--accent);
    background: rgba(108, 92, 231, 0.1);
    border-left-color: var(--accent);
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.user-info-mini {
    display: flex;
    flex-direction: column;
}

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

.user-rank {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.admin-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Content Area ---- */
.content-area {
    padding: 28px;
    max-width: 1100px;
}

/* ============================================
   GREETING
   ============================================ */
.greeting-section {
    margin-bottom: 28px;
}

.greeting-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.greeting-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

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

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

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(108, 92, 231, 0.1);
}

.stat-level .stat-icon { background: rgba(243, 156, 18, 0.12); }
.stat-xp .stat-icon { background: rgba(108, 92, 231, 0.12); }
.stat-streak .stat-icon { background: rgba(231, 76, 60, 0.12); }
.stat-today .stat-icon { background: rgba(46, 204, 113, 0.12); }

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

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

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   XP PROGRESS BAR
   ============================================ */
.xp-progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.xp-level {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-numbers {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a29bfe);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.xp-remaining {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* ============================================
   ATTRIBUTES
   ============================================ */
.attributes-section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

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

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

.attribute-item:hover {
    border-color: var(--border-light);
}

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

.attr-icon {
    font-size: 1.2rem;
}

.attr-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1;
}

.attr-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.attr-bar {
    height: 6px;
}

.attr-bar .progress-fill {
    border-radius: 3px;
}

.attr-bar .progress-fill::after {
    display: none;
}

/* ============================================
   TASKS
   ============================================ */
.tasks-section {
    margin-bottom: 28px;
}

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

.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.task-item:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.task-completed {
    opacity: 0.5;
}

.task-completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-check {
    flex-shrink: 0;
}

.btn-complete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.check-circle {
    display: block;
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    transition: var(--transition);
}

.btn-complete:hover .check-circle {
    border-color: var(--success);
    background: var(--success-bg);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.3);
}

.check-done {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.task-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.task-attr {
    font-size: 0.78rem;
    font-weight: 600;
}

.task-xp {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

.task-type-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-diaria {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
}

.badge-semanal {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.task-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ============================================
   ACTIVITY LOG
   ============================================ */
.activity-section {
    margin-bottom: 28px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.activity-item:hover {
    border-color: var(--border-light);
}

.activity-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.activity-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

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

/* ---- Log Page ---- */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-date-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.log-item:hover {
    background: var(--bg-card);
}

.log-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.log-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

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

/* ============================================
   PROFILE
   ============================================ */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 28px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.profile-avatar-large img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
}

.profile-rank {
    font-size: 0.9rem;
    font-weight: 700;
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-joined {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.profile-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.profile-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Avatar Grid ---- */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 12px;
    padding: 8px 0;
}

.avatar-option {
    background: none;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-option:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.avatar-selected {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 12px var(--accent-glow);
}

.avatar-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-option-label img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-option-label:hover {
    border-color: var(--accent);
}

.avatar-radio {
    display: none;
}

.avatar-radio:checked + img {
    box-shadow: 0 0 0 3px var(--accent);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.create-task-card {
    border-color: var(--accent);
    border-style: dashed;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input[type="file"] {
    padding: 8px;
}

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

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-group-lg {
    flex: 2;
}

.form-group-btn {
    display: flex;
    align-items: flex-end;
    margin-bottom: 16px;
}

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

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
    padding: 6px 10px;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.88rem;
}

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

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

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

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(46, 204, 113, 0.2);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(231, 76, 60, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(243, 156, 18, 0.2);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

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

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

/* ============================================
   TABLE
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.data-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.04);
}

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.role-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-user {
    background: rgba(52, 152, 219, 0.15);
    color: var(--info);
}

.role-admin {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

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

/* ============================================
   ASSETS GRID (Admin)
   ============================================ */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.asset-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    transition: var(--transition);
}

.asset-item:hover {
    border-color: var(--border-light);
}

.asset-item img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.asset-name {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 8px;
}

.upload-form .form-row {
    align-items: flex-end;
}

.info-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-text code {
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--accent);
}

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

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
}

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

.auth-header .logo-text {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

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

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .btn {
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ============================================
   PAGE TITLE
   ============================================ */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* ============================================
   XP TOAST NOTIFICATION
   ============================================ */
.xp-toast {
    position: fixed;
    top: 80px;
    right: 28px;
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(46, 204, 113, 0.2);
    z-index: 300;
    animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}

.xp-toast-icon {
    font-size: 1.5rem;
}

.xp-toast-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
}

.xp-toast-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   LEVEL UP ANIMATION
   ============================================ */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    animation: fadeIn 0.3s ease;
}

.level-up-content {
    text-align: center;
    animation: levelUpPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-content h2 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f39c12, #e74c3c, #9b59b6, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.level-up-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes levelUpPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .menu-toggle {
        display: block;
    }

    .content-area {
        padding: 20px 16px;
    }

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

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

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

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

    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

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

    .topbar {
        padding: 0 16px;
    }

    .xp-toast {
        right: 16px;
        left: 16px;
    }

    .modal {
        margin: 16px;
        padding: 20px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

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

    .auth-card {
        padding: 28px 20px;
    }

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

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

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

    .greeting-section h2 {
        font-size: 1.2rem;
    }
}

/* ---- Overlay for mobile sidebar ---- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}
