/* ========================================
   ROT — Dashboard Styles
   ======================================== */

/* --- Layout --- */
.dashboard {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
    width: 240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-family: var(--font-mono);
    width: 100%;
    text-align: left;
}

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

.nav-item.active {
    background: var(--bg-elevated);
    color: var(--accent);
}

.nav-item .nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
}

.view-portfolio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.view-portfolio-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    min-width: 0;
}

.editor-panel {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 640px;
}

.preview-panel {
    flex: 1;
    border-left: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

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

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    outline: none;
}

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

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

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* --- PFP Upload --- */
.pfp-upload-area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pfp-preview-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.pfp-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.pfp-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
}

.remove-btn:hover {
    color: #ff6b6b;
}

/* --- Header Upload --- */
.header-upload-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.header-preview-box {
    width: 100%;
    height: 120px;
    background: var(--bg-primary);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-preview-box.has-image {
    border-style: solid;
}

.header-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.header-placeholder span {
    font-size: 1.2rem;
}

.header-upload-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Section Order Drag List --- */
.section-order-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section-order-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: -1px;
    cursor: grab;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
}

.section-order-item:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.section-order-item:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-bottom: 0;
}

.section-order-item:only-child {
    border-radius: var(--radius-sm);
}

.section-order-item:hover {
    background: var(--bg-elevated);
}

.section-order-item.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.section-order-item.drag-over {
    border-top: 2px solid var(--accent);
    padding-top: calc(0.7rem - 1px);
}

.section-order-grip {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}

.section-order-icon {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.section-order-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* --- Dynamic List Items (Links, Experience, etc.) --- */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dynamic-item {
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative;
    transition: border-color var(--transition-fast);
}

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

.dynamic-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dynamic-item-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dynamic-item-actions {
    display: flex;
    gap: 0.3rem;
}

.item-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.item-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.item-action-btn.delete:hover {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

.dynamic-item .form-group {
    margin-bottom: 0.75rem;
}

.dynamic-item .form-group:last-child {
    margin-bottom: 0;
}

.dynamic-item .form-label {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
}

.dynamic-item .form-input,
.dynamic-item .form-textarea {
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Add Item Button */
.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.65rem;
    background: none;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-item-btn:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
    background: var(--accent-glow);
}

/* --- Skills Input --- */
.skills-input-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 48px;
    cursor: text;
    transition: border-color var(--transition-fast);
}

.skills-input-area:focus-within {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-primary);
    animation: chipIn 0.2s ease-out;
}

@keyframes chipIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.skill-chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.skill-chip-remove:hover {
    color: #ff6b6b;
}

.skill-input-field {
    flex: 1;
    min-width: 100px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
    padding: 0.2rem 0.3rem;
}

.skill-input-field::placeholder {
    color: var(--text-muted);
}

/* --- Save Bar --- */
.save-bar {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    padding: 1rem 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    z-index: 100;
    transform: translateY(100%);
    transition: transform var(--transition-smooth);
    backdrop-filter: blur(12px);
}

.save-bar.visible {
    transform: translateY(0);
}

.save-bar-text {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.discard-btn {
    padding: 0.55rem 1rem;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.save-btn {
    padding: 0.55rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.save-btn:active {
    transform: translateY(0);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--accent-dim);
}

.toast.error {
    border-color: #ff6b6b;
}

/* --- Preview Iframe Container --- */
.preview-frame {
    width: 375px;
    height: 680px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-label {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Section Divider --- */
.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .preview-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 200;
        transition: left var(--transition-smooth);
    }

    .sidebar.open {
        left: 0;
    }

    .editor-panel {
        padding: 1.5rem;
    }

    .save-bar {
        left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 201;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

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

/* ========================================
   Theme Cards
   ======================================== */

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

.theme-card {
    padding: 0;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    font-family: var(--font-mono);
}

.theme-card:hover {
    border-color: var(--border-light);
}

.theme-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-preview {
    height: 120px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

/* Dark theme preview */
.theme-preview-dark {
    background: #0a0a0a;
}

.theme-preview-dark .tp-header {
    width: 80%;
    height: 28px;
    background: #1a1a1a;
    border-radius: 4px;
}

.theme-preview-dark .tp-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2a2a2a;
    margin-top: -10px;
    border: 2px solid #0a0a0a;
}

.theme-preview-dark .tp-line {
    height: 4px;
    border-radius: 2px;
    background: #1e1e1e;
}

.theme-preview-dark .tp-line-1 {
    width: 50%;
}

.theme-preview-dark .tp-line-2 {
    width: 35%;
}

/* Light theme preview */
.theme-preview-light {
    background: #f5f5f5;
}

.theme-preview-light .tp-header {
    width: 80%;
    height: 28px;
    background: #e0e0e0;
    border-radius: 4px;
}

.theme-preview-light .tp-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #cccccc;
    margin-top: -10px;
    border: 2px solid #f5f5f5;
}

.theme-preview-light .tp-line {
    height: 4px;
    border-radius: 2px;
    background: #ddd;
}

.theme-preview-light .tp-line-1 {
    width: 50%;
}

.theme-preview-light .tp-line-2 {
    width: 35%;
}

.theme-card-label {
    padding: 0.6rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.theme-card.active .theme-card-label {
    color: var(--accent);
}

/* ========================================
   Account Button
   ======================================== */

.account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
}

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

/* ========================================
   Icon Picker Modal
   ======================================== */

.icon-picker-modal {
    max-width: 440px;
    max-height: 80vh;
}

.icon-picker-search-wrap {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 0.75rem;
    overflow-y: auto;
    max-height: 50vh;
}

.icon-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 1.15rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
}

.icon-picker-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-picker-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-color);
}

.icon-picker-btn.selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.icon-picker-btn .ip-label {
    display: none;
}

/* Link icon button in editor */
.link-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
}

.link-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.link-icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ========================================
   Account Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-overlay.visible .modal {
    transform: translateY(0) scale(1);
}

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

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

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

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

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-section {
    margin-bottom: 1.75rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Account Fields */
.account-field {
    margin-bottom: 1rem;
}

.account-field:last-child {
    margin-bottom: 0;
}

.account-field .form-label {
    font-size: 0.65rem;
    margin-bottom: 0.35rem;
}

.account-field .form-input {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    background: var(--bg-primary);
}

/* Slug Input */
.slug-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.slug-input-wrap:focus-within {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.slug-prefix {
    padding: 0.6rem 0 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex-shrink: 0;
    user-select: none;
}

.slug-input {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
}

/* Subscription Card */
.subscription-card {
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.sub-plan-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.sub-plan-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.sub-plan-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sub-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sub-badge.free {
    background: rgba(122, 122, 122, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.sub-badge.pro {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
}

.sub-details {
    margin-bottom: 0.85rem;
}

.sub-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sub-detail-row:last-child {
    border-bottom: none;
}

.sub-detail-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sub-detail-value {
    font-size: 0.72rem;
    color: var(--text-primary);
    font-weight: 500;
}

.upgrade-btn {
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upgrade-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Password Change */
.change-pw-btn {
    margin-top: 0.75rem;
    padding: 0.55rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.change-pw-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
}

/* Danger Zone */
.danger-zone .modal-section-label::after {
    background: rgba(255, 107, 107, 0.2);
}

.danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.04);
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: var(--radius-sm);
}

.danger-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

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

.delete-account-btn {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: var(--radius-sm);
    color: #ff6b6b;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.delete-account-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ========================================
   World Map — Dashboard Editor
   ======================================== */
.map-preview-wrapper {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.map-preview-wrapper .world-map-svg {
    width: 100%;
    height: auto;
    display: block;
}

.map-preview-wrapper .wm-country {
    cursor: pointer;
}

.map-preview-wrapper .wm-country:hover {
    fill: var(--bg-hover);
    stroke: var(--text-muted);
    stroke-width: 1;
}

.map-preview-wrapper .wm-current:hover {
    fill: var(--accent);
}

.map-preview-wrapper .wm-visited:hover {
    opacity: 0.85;
    fill: var(--accent-dim);
}

/* Country search dropdown */
.map-country-select {
    position: relative;
}

.map-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.map-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.map-dropdown-item:hover {
    background: var(--bg-hover);
}

/* Current country badge */
.map-current-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--accent-glow);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-sm);
}

.map-badge-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.map-badge-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
    margin-left: auto;
}

.map-badge-remove:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Visited country tags */
.map-visited-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    min-height: 28px;
}

.map-visited-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: border-color var(--transition-fast);
}

.map-visited-tag:hover {
    border-color: var(--accent-dim);
}

.map-tag-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 1px 3px;
    border-radius: 3px;
    transition: color var(--transition-fast);
}

.map-tag-remove:hover {
    color: #ff6b6b;
}

.map-tags-empty {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.3rem 0;
}

/* ========================================
   Revenue Section (Editor)
   ======================================== */
.revenue-providers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.revenue-provider-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.revenue-provider-card:hover {
    border-color: var(--border-light);
}

.revenue-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.revenue-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-elevated);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}

.revenue-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}

.revenue-toggle input:checked+.revenue-toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

.revenue-toggle input:checked+.revenue-toggle-slider:before {
    transform: translateX(16px);
    background-color: var(--bg-main);
}

.revenue-provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
}

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

.revenue-provider-logo {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: capitalize;
}

.revenue-provider-body {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
    display: none;
}

.revenue-provider-card.active .revenue-provider-body {
    display: block;
}

.revenue-key-input {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.revenue-fetch-single {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.revenue-fetch-single:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Revenue Preview in Dashboard */
.revenue-preview {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 0.5rem;
}

.revenue-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.revenue-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.revenue-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.revenue-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.revenue-stat-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.revenue-chart-container {
    height: 100px;
    width: 100%;
    position: relative;
}

.revenue-chart-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
/* --- Analytics Section --- */
.analytics-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

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

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-change.positive { color: #4ade80; }
.stat-change.negative { color: #f87171; }

.analytics-table-frame {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.analytics-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
}

.analytics-table td {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

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

@media (max-width: 600px) {
    .analytics-overview {
        grid-template-columns: 1fr;
    }
}
