/* ============================================
   DATAEDGE FRAMEWORK CSS
   Complete design system for framework + apps
   ============================================ */

/* ========== DESIGN TOKENS ========== */
:root {
    /* Framework-specific */
    --header-height: 60px;
    --sidebar-width: 240px;

    /* Color Palette */
    --de-primary: #60a5fa;
    --de-accent: #34d399;
    --de-error: #ef4444;
    --de-error-light: #fca5a5;

    /* Text Colors */
    --de-text: #e2e8f0;
    --de-text-secondary: #94a3b8;
    --de-text-muted: #64748b;
    --de-text-placeholder: #475569;

    /* Background Colors */
    --de-bg-gradient: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    --de-bg-glass: rgba(30, 41, 59, 0.7);
    --de-bg-glass-dark: rgba(30, 41, 59, 0.9);
    --de-bg-glass-light: rgba(30, 41, 59, 0.5);
    --de-bg-glass-hover: rgba(59, 130, 246, 0.15);
    --de-bg-input: rgba(51, 65, 85, 0.6);
    --de-bg-input-focus: rgba(51, 65, 85, 0.8);
    --de-bg-card-hover: rgba(59, 130, 246, 0.1);

    /* Border Colors */
    --de-border: rgba(59, 130, 246, 0.3);
    --de-border-light: rgba(59, 130, 246, 0.2);
    --de-border-active: rgba(52, 211, 153, 0.4);
    --de-border-green: rgba(52, 211, 153, 0.3);
    --de-border-error: rgba(239, 68, 68, 0.3);

    /* Gradients */
    --de-gradient-primary: linear-gradient(135deg, #3b82f6, #34d399);
    --de-gradient-primary-reverse: linear-gradient(135deg, #34d399, #3b82f6);
    --de-gradient-top-bar: linear-gradient(90deg, #3b82f6, #34d399);

    /* Shadows */
    --de-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --de-shadow-hover: 0 6px 20px rgba(52, 211, 153, 0.4);
    --de-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Spacing Scale */
    --de-space-xs: 0.5rem;
    --de-space-sm: 0.75rem;
    --de-space-md: 1rem;
    --de-space-lg: 1.5rem;
    --de-space-xl: 2rem;
    --de-space-2xl: 2.5rem;

    /* Border Radius */
    --de-radius-sm: 6px;
    --de-radius-md: 8px;
    --de-radius-lg: 12px;
    --de-radius-xl: 16px;

    /* Transitions */
    --de-transition: all 0.3s ease;
    --de-transition-fast: all 0.2s ease;

    /* Typography */
    --de-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --de-font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ========== BASE RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--de-font-family);
    background: var(--de-bg-gradient);
    color: var(--de-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.4);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.6);
}

/* ========== LAYOUT COMPONENTS ========== */

/* Container */
.de-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--de-space-lg);
}

/* Card */
.de-card {
    background: var(--de-bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-lg);
    padding: var(--de-space-xl);
    box-shadow: var(--de-shadow);
    position: relative;
    overflow: hidden;
    transition: var(--de-transition);
}

.de-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--de-gradient-top-bar);
    opacity: 0.7;
}

.de-card:hover {
    border-color: var(--de-border-active);
}

.de-card-interactive {
    cursor: pointer;
}

.de-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--de-shadow-hover);
}

.de-card-interactive:hover::before {
    opacity: 1;
}

/* Section */
.de-section {
    margin-bottom: var(--de-space-2xl);
}

/* Header */
.de-header {
    text-align: center;
    margin-bottom: var(--de-space-xl);
    background: var(--de-bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--de-radius-lg);
    padding: var(--de-space-xl) var(--de-space-lg);
    border: 1px solid var(--de-border);
    box-shadow: var(--de-shadow);
}

/* ========== TYPOGRAPHY ========== */

h1, .de-h1 {
    font-size: 2.2rem;
    color: var(--de-primary);
    margin-bottom: var(--de-space-md);
    font-weight: 600;
    letter-spacing: -0.025em;
}

h2, .de-h2 {
    color: var(--de-primary);
    margin-bottom: var(--de-space-lg);
    font-size: 1.4rem;
    font-weight: 600;
    padding-bottom: var(--de-space-xs);
    border-bottom: 1px solid var(--de-border-green);
}

h3, .de-h3 {
    color: var(--de-primary);
    margin-bottom: var(--de-space-md);
    font-size: 1.2rem;
    font-weight: 600;
}

.de-subtitle {
    color: var(--de-text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.de-text-secondary {
    color: var(--de-text-secondary);
}

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

.de-text-mono {
    font-family: var(--de-font-family-mono);
}

code, .de-code {
    background: rgba(51, 65, 85, 0.8);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--de-accent);
    font-family: var(--de-font-family-mono);
    font-size: 0.9em;
    border: 1px solid var(--de-border-green);
}

/* ========== FORM COMPONENTS ========== */

/* Form Group */
.de-form-group {
    margin-bottom: var(--de-space-lg);
}

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

/* Input */
.de-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--de-bg-input);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    color: var(--de-text);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--de-transition);
}

.de-input:focus {
    outline: none;
    border-color: var(--de-accent);
    background: var(--de-bg-input-focus);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

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

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

/* Input Sizes */
.de-input-sm {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.de-input-lg {
    padding: 16px 20px;
    font-size: 1.1rem;
}

/* Textarea */
.de-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--de-bg-input);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    color: var(--de-text);
    font-size: 1rem;
    font-family: var(--de-font-family-mono);
    line-height: 1.8;
    resize: vertical;
    min-height: 100px;
    transition: var(--de-transition);
}

.de-textarea:focus {
    outline: none;
    border-color: var(--de-accent);
    background: var(--de-bg-input-focus);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

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

/* Select */
.de-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--de-bg-input);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    color: var(--de-text);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--de-transition);
    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='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.de-select:focus {
    outline: none;
    border-color: var(--de-accent);
    background: var(--de-bg-input-focus);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

/* Checkbox */
.de-checkbox {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--de-accent);
}

/* File Input */
.de-file-input {
    width: 100%;
    padding: 12px;
    background: var(--de-bg-input);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    color: var(--de-text);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--de-transition);
}

.de-file-input::file-selector-button {
    background: var(--de-gradient-primary);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: var(--de-radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: var(--de-transition);
}

.de-file-input::file-selector-button:hover {
    background: var(--de-gradient-primary-reverse);
}

/* Input with Toggle (password visibility) */
.de-input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.de-input-with-toggle input {
    padding-right: 3rem;
}

.de-toggle-btn {
    position: absolute;
    right: 0.5rem;
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-sm);
    padding: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--de-transition);
    user-select: none;
}

.de-toggle-btn:hover {
    background: rgba(51, 65, 85, 1);
    border-color: var(--de-border-active);
}

.de-toggle-btn:active {
    transform: scale(0.95);
}

/* Helper Text */
.de-help-text {
    display: block;
    color: var(--de-text-secondary);
    font-size: 0.85rem;
    margin-top: var(--de-space-xs);
}

/* ========== BUTTON COMPONENTS ========== */

/* Base Button */
.de-btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--de-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--de-transition);
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    line-height: 1;
}

.de-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.de-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Primary Button */
.de-btn-primary {
    background: var(--de-gradient-primary);
    color: #000;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.de-btn-primary:hover:not(:disabled) {
    background: var(--de-gradient-primary-reverse);
    transform: translateY(-2px);
    box-shadow: var(--de-shadow-hover);
}

/* Secondary Button */
.de-btn-secondary {
    background: rgba(51, 65, 85, 0.8);
    color: var(--de-text);
    border: 1px solid var(--de-border);
}

.de-btn-secondary:hover:not(:disabled) {
    background: var(--de-bg-glass-hover);
    border-color: var(--de-accent);
}

/* Danger Button */
.de-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--de-error-light);
    border: 1px solid var(--de-border-error);
}

.de-btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
    border-color: var(--de-error);
}

/* Icon Button */
.de-btn-icon {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid var(--de-border);
    color: var(--de-text);
    font-size: 1.3rem;
    width: 38px;
    height: 38px;
    border-radius: var(--de-radius-md);
    cursor: pointer;
    transition: var(--de-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.de-btn-icon:hover:not(:disabled) {
    background: rgba(51, 65, 85, 1);
    border-color: var(--de-border-active);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

/* Button Sizes */
.de-btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.de-btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.de-btn-block {
    width: 100%;
}

/* ========== STATUS COMPONENTS ========== */

/* Status Message */
.de-status {
    margin-top: var(--de-space-lg);
    padding: 14px 18px;
    border-radius: var(--de-radius-md);
    font-size: 0.95rem;
    display: none;
    border: 1px solid transparent;
}

.de-status.show {
    display: block;
}

.de-status-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: var(--de-accent);
    color: var(--de-accent);
}

.de-status-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--de-error);
    color: var(--de-error-light);
}

.de-status-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: var(--de-primary);
}

.de-status-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #fbbf24;
}

/* Toast */
.de-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--de-border-green);
    border-radius: var(--de-radius-md);
    padding: 15px 20px;
    color: var(--de-accent);
    font-size: 0.95rem;
    box-shadow: var(--de-shadow);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.de-toast.show {
    transform: translateX(0);
}

.de-toast.error {
    border-color: var(--de-border-error);
    color: var(--de-error-light);
}

/* ========== MODAL COMPONENTS ========== */

/* Modal Overlay */
.de-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.de-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.de-modal-content {
    background: var(--de-bg-glass-dark);
    backdrop-filter: blur(10px);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-xl);
    box-shadow: var(--de-shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.de-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--de-gradient-top-bar);
    border-radius: var(--de-radius-xl) var(--de-radius-xl) 0 0;
}

/* Modal Sizes */
.de-modal-sm {
    max-width: 400px;
}

.de-modal-lg {
    max-width: 800px;
}

.de-modal-xl {
    max-width: 1200px;
}

/* Modal Header */
.de-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--de-border-light);
}

.de-modal-header h2 {
    color: var(--de-primary);
    font-size: 1.5rem;
    margin: 0;
    border: none;
    padding: 0;
}

/* Modal Body */
.de-modal-body {
    padding: 30px;
}

/* Modal Footer */
.de-modal-footer {
    display: flex;
    gap: var(--de-space-md);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--de-border-light);
    justify-content: flex-end;
}

/* Close Button */
.de-close-btn {
    background: none;
    border: none;
    color: var(--de-text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--de-transition);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--de-radius-sm);
}

.de-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--de-error);
    transform: rotate(90deg);
}

/* ========== LIST COMPONENTS ========== */

/* Grid */
.de-grid {
    display: grid;
    gap: var(--de-space-lg);
}

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

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

.de-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.de-grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* List */
.de-list {
    list-style: none;
    padding: 0;
}

.de-list-item {
    padding: var(--de-space-sm) 0;
    padding-left: 28px;
    position: relative;
    color: var(--de-text-secondary);
    line-height: 1.6;
}

.de-list-item::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--de-accent);
    font-weight: bold;
}

/* ========== UTILITY CLASSES ========== */

/* Display */
.de-flex {
    display: flex;
}

.de-flex-col {
    display: flex;
    flex-direction: column;
}

.de-items-center {
    align-items: center;
}

.de-justify-center {
    justify-content: center;
}

.de-justify-between {
    justify-content: space-between;
}

.de-gap-sm {
    gap: var(--de-space-sm);
}

.de-gap-md {
    gap: var(--de-space-md);
}

.de-gap-lg {
    gap: var(--de-space-lg);
}

/* Spacing */
.de-m-0 { margin: 0; }
.de-mb-sm { margin-bottom: var(--de-space-sm); }
.de-mb-md { margin-bottom: var(--de-space-md); }
.de-mb-lg { margin-bottom: var(--de-space-lg); }
.de-mb-xl { margin-bottom: var(--de-space-xl); }

.de-p-0 { padding: 0; }
.de-p-sm { padding: var(--de-space-sm); }
.de-p-md { padding: var(--de-space-md); }
.de-p-lg { padding: var(--de-space-lg); }
.de-p-xl { padding: var(--de-space-xl); }

/* Text Alignment */
.de-text-center {
    text-align: center;
}

.de-text-left {
    text-align: left;
}

.de-text-right {
    text-align: right;
}

/* Other */
.de-hidden {
    display: none !important;
}

.de-visible {
    display: block !important;
}

/* ============================================
   FRAMEWORK-SPECIFIC STYLES
   (Dashboard chrome, tabs, sidebar)
   ============================================ */

body.framework {
    overflow: hidden;
    height: 100vh;
}

/* Framework Layout */
.framework {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ========== HEADER ========== */
.framework-header {
    height: var(--header-height);
    background: var(--de-bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--de-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
    z-index: 100;
}

.framework-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--de-gradient-top-bar);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--de-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--de-radius-sm);
    transition: var(--de-transition-fast);
}

.hamburger-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: var(--de-accent);
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--de-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--de-accent) transparent;
}

.tab-bar::-webkit-scrollbar {
    height: 4px;
}

.tab-bar::-webkit-scrollbar-track {
    background: transparent;
}

.tab-bar::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.3);
    border-radius: 2px;
}

.tab-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.5);
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid var(--de-border);
    border-top: 3px solid transparent;
    border-radius: var(--de-radius-md);
    color: var(--de-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--de-transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    animation: tabFadeIn 0.2s ease-out;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tab:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--de-text);
    transform: translateY(-1px);
}

.tab.active {
    background: rgba(51, 65, 85, 0.8);
    border-color: var(--de-border);
    border-top-color: var(--de-accent);
    color: var(--de-text);
}

.tab-emoji {
    font-size: 1rem;
    line-height: 1;
}

.tab-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 2px;
    color: var(--de-text-secondary);
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: var(--de-transition-fast);
    font-weight: 500;
}

.tab:hover .tab-close {
    opacity: 1;
    color: var(--de-text);
}

.tab-close:hover {
    color: var(--de-error);
    transform: scale(1.15);
}

/* Header Separator */
.header-separator {
    width: 1px;
    height: 28px;
    background: var(--de-border);
    margin-left: 20px;
    flex-shrink: 0;
}

/* Widget Button */
.widgets-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 12px;
    padding: 0;
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    color: var(--de-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--de-transition-fast);
    flex-shrink: 0;
}

.widgets-tab-btn:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--de-text);
    transform: translateY(-1px);
}

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

.new-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(52, 211, 153, 0.2);
    border: 1px solid var(--de-accent);
    border-radius: 50%;
    color: var(--de-accent);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--de-transition);
    flex-shrink: 0;
}

.new-tab-btn:hover {
    background: rgba(52, 211, 153, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid var(--de-border);
    color: var(--de-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: var(--de-radius-md);
    transition: var(--de-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--de-bg-glass-hover);
    border-color: var(--de-accent);
    color: var(--de-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

/* Widgets Dropdown */
.widgets-dropdown {
    position: fixed;
    min-width: 280px;
    background: var(--de-glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--de-glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 8px;
    z-index: 10001;
    animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widgets-dropdown-header {
    padding: 12px 12px 8px;
    color: var(--de-primary);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    margin-bottom: 4px;
}

.widgets-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.widgets-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.widgets-dropdown-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.widgets-dropdown-content {
    flex: 1;
}

.widgets-dropdown-name {
    color: var(--de-text);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.widgets-dropdown-desc {
    color: var(--de-text-muted);
    font-size: 12px;
    line-height: 1.3;
}

/* ========== MAIN CONTENT ========== */
.framework-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.framework-sidebar {
    width: var(--sidebar-width);
    background: var(--de-bg-glass);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--de-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    position: relative;
    z-index: 50;
    flex-shrink: 0;
}

.framework-sidebar.hidden {
    width: 0;
    transform: translateX(-240px);
    border-right: none;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0 10px 0;
}

/* Category Section */
.sidebar-category {
    margin-bottom: 8px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--de-transition-fast);
    border-radius: var(--de-radius-sm);
    margin: 0 8px;
}

.category-header:hover {
    background: rgba(51, 65, 85, 0.4);
}

.category-header:hover .category-icon {
    color: var(--de-accent);
}

.category-title {
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--de-text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-size: 1rem;
    color: var(--de-text-muted);
    transition: transform 0.2s ease;
    display: inline-block;
    transform: rotate(90deg);
}

.sidebar-category.collapsed .category-icon {
    transform: rotate(0deg);
}

.category-apps {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.sidebar-category.collapsed .category-apps {
    max-height: 0;
    opacity: 0;
}

/* App Item */
.sidebar-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 15px;
    margin: 3px 8px;
    cursor: pointer;
    border: 1px solid transparent;
    border-top: 2px solid transparent;
    border-radius: var(--de-radius-sm);
    transition: var(--de-transition-fast);
    text-decoration: none;
    color: var(--de-text);
    position: relative;
}

.sidebar-app:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(52, 211, 153, 0.2);
    transform: translateX(2px);
}

.sidebar-app.active {
    background: rgba(51, 65, 85, 0.6);
    border-color: var(--de-border);
    border-top-color: var(--de-accent);
}

.app-emoji {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.app-name {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

/* ========== CONTENT AREA (iframe) ========== */
.framework-content {
    flex: 1;
    position: relative;
    background: var(--de-bg-gradient);
    overflow: hidden;
}

.app-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.app-iframe.visible {
    opacity: 1;
}

/* Loading state */
.content-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--de-text-secondary);
}

.loading-spinner {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

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

/* Welcome screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-screen h1 {
    font-size: 3rem;
    color: var(--de-primary);
    margin-bottom: 20px;
}

.welcome-screen p {
    font-size: 1.2rem;
    color: var(--de-text-secondary);
    margin-bottom: 30px;
    max-width: 600px;
}

.welcome-section {
    width: 100%;
    max-width: 800px;
}

.welcome-section h3 {
    font-size: 1.2rem;
    color: var(--de-accent);
    margin-bottom: 20px;
    text-align: center;
}

.welcome-apps {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.welcome-app-btn {
    background: var(--de-bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-md);
    padding: 15px 25px;
    color: var(--de-text);
    text-decoration: none;
    transition: var(--de-transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-app-btn:hover {
    background: var(--de-bg-glass-hover);
    border-color: var(--de-border-active);
    transform: translateY(-2px);
}

/* ========== KEYBOARD HELP MODAL ========== */
.keyboard-help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.keyboard-help-modal.active {
    display: flex;
}

.keyboard-help-content {
    background: var(--de-bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--de-border);
    border-radius: var(--de-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--de-shadow-lg);
    animation: modalFadeIn 0.2s ease-out;
}

.keyboard-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--de-border);
}

.keyboard-help-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--de-primary);
    border: none;
    padding: 0;
}

.keyboard-help-body {
    padding: 24px;
}

.shortcut-section {
    margin-bottom: 24px;
}

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

.shortcut-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--de-text-muted);
    margin: 0 0 12px 0;
    font-weight: 600;
    border: none;
    padding: 0;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: var(--de-radius-sm);
    transition: background 0.2s ease;
}

.shortcut-item:hover {
    background: rgba(51, 65, 85, 0.4);
}

.shortcut-keys {
    display: flex;
    gap: 6px;
    align-items: center;
}

.shortcut-keys kbd {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid var(--de-border);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: var(--de-font-family-mono);
    font-size: 0.85rem;
    color: var(--de-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 32px;
    text-align: center;
}

.shortcut-desc {
    color: var(--de-text-secondary);
    font-size: 0.95rem;
}

/* ========== RESPONSIVE ========== */

/* Mobile */
@media (max-width: 768px) {
    .tab-bar {
        max-width: 300px;
        margin-left: 10px;
        padding-left: 10px;
    }

    .tab-name {
        max-width: 80px;
    }

    .framework-sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        z-index: 200;
    }

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

    /* Mobile overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

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

    /* Show text in mobile sidebar */
    .framework-sidebar.mobile-open .app-name,
    .framework-sidebar.mobile-open .category-title {
        opacity: 1;
        width: auto;
    }

    .framework-sidebar.mobile-open .sidebar-app {
        justify-content: flex-start;
        padding: 10px 15px;
    }

    .framework-sidebar.mobile-open .category-header {
        justify-content: space-between;
        padding: 10px 15px;
    }

    /* App responsive */
    .de-grid-2,
    .de-grid-3,
    .de-grid-4 {
        grid-template-columns: 1fr;
    }

    .de-grid-auto {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-logo {
        font-size: 1.2rem;
    }

    .header-btn {
        font-size: 1rem;
        padding: 6px;
    }

    .welcome-screen h1 {
        font-size: 2rem;
    }

    .welcome-screen p {
        font-size: 1rem;
    }

    /* App responsive */
    .de-container {
        padding: var(--de-space-md);
    }

    .de-card {
        padding: var(--de-space-lg);
    }

    .de-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}
