:root {
    --bg-main: #f8fafc;
    
    /* Sidebar Dark Theme */
    --sidebar-bg: rgba(15, 23, 42, 0.95);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-text: #f8fafc;
    --sidebar-text-sec: #94a3b8;

    /* Main Content Light Theme */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.page {
    display: flex;
    height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.glass-sidebar {
    width: 300px;
    height: 100%;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
}

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

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    color: var(--sidebar-text-sec);
    text-decoration: none;
    transition: all 0.2s;
}

.settings-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text);
}

/* Tree Navigation */
.tree-root {
    list-style: none;
    padding: 10px;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.tree-children {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.tree-item {
    margin: 2px 0;
}

.item-title {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sidebar-text-sec);
    transition: all 0.2s;
    user-select: none;
}

.item-title:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text);
}

.page-item.selected > .item-title {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.icon {
    font-size: 1.1em;
}

/* Login Page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.form-control {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

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

.error-alert {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Editor container */
.editor-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-iframe {
    flex: 1;
    width: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: transparent;
}

/* User Management */
.users-wrapper {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.table-panel {
    max-width: none;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

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

.users-table th, .users-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.users-table th {
    background: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}
.role-badge.admin {
    background: rgba(192, 132, 252, 0.2);
    color: #9333ea;
}
.role-badge.user {
    background: rgba(96, 165, 250, 0.2);
    color: #2563eb;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
}
.text-danger {
    color: #ef4444;
}
.text-danger:hover {
    color: #dc2626;
}