/* Application Styles */

/* Browser Tabs */
.browser-tabs-bar {
    display: flex;
    background: linear-gradient(180deg, rgba(40, 40, 45, 0.95) 0%, rgba(30, 30, 35, 0.95) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    padding: 6px 6px 0 6px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tabs-container {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.browser-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(50, 50, 60, 0.8) 0%, rgba(40, 40, 50, 0.8) 100%);
    border-radius: 8px 8px 0 0;
    min-width: 140px;
    max-width: 220px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    position: relative;
}

.browser-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
}

.browser-tab:hover {
    background: linear-gradient(180deg, rgba(60, 60, 70, 0.9) 0%, rgba(50, 50, 60, 0.9) 100%);
    transform: translateY(-1px);
}

.browser-tab.active {
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.browser-tab.active::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.tab-icon {
    font-size: 16px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.tab-title {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.browser-tab.active .tab-title {
    color: rgba(255, 255, 255, 0.98);
    font-weight: 500;
}

.tab-close {
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 4px;
    flex-shrink: 0;
}

.tab-close:hover {
    background: rgba(255, 85, 85, 0.2);
    color: #ff5555;
    transform: scale(1.15);
}

.new-tab-button {
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(60, 60, 70, 0.7) 0%, rgba(50, 50, 60, 0.7) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    font-weight: 300;
    transition: all 0.2s;
    flex-shrink: 0;
}

.new-tab-button:hover {
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.25) 100%);
    color: white;
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* File Manager */
.file-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.file-manager-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toolbar-button {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: white;
    font-size: 12px;
    transition: background 0.15s;
}

.toolbar-button:hover {
    background: rgba(255,255,255,0.1);
}

.file-manager-path {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.file-manager-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
}

.file-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
    transition: background 0.15s, transform 0.12s;
}

.file-item.selected {
    background: rgba(100, 130, 255, 0.25);
    outline: 1px solid rgba(102, 136, 255, 0.7);
    outline-offset: -1px;
    box-shadow: 0 0 8px rgba(102, 136, 255, 0.15);
}

.file-item-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.file-item-name {
    color: white;
    font-size: 12px;
    text-align: center;
    word-break: break-word;
}

.file-item-meta {
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    text-align: center;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

/* Breadcrumb */
.fm-breadcrumb span:not(.fm-breadcrumb-sep) {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    padding: 1px 3px;
    border-radius: 3px;
    transition: background 0.12s, color 0.12s;
}

.fm-breadcrumb span:not(.fm-breadcrumb-sep):hover {
    background: rgba(100, 130, 255, 0.25);
    color: #fff;
}

/* Status bar */
.fm-status-bar {
    padding: 5px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* Inline rename / create input */
.fm-inline-input {
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(100, 130, 255, 0.6);
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    width: 80px;
    outline: none;
    text-align: center;
}

.fm-inline-input:focus {
    border-color: #6688ff;
    box-shadow: 0 0 0 2px rgba(102, 136, 255, 0.25);
}

/* Sort select in toolbar */
.fm-sort-group {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.fm-sort-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
}

.fm-sort-btn:hover,
.fm-sort-btn:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.fm-sort-btn option {
    background: #1e1e2e;
    color: #fff;
}

/* Nav buttons (back/forward) disabled state */
.fm-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* Sidebar */
.fm-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fm-sidebar {
    width: 180px;
    min-width: 180px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.fm-sidebar-section {
    padding: 8px 14px 4px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
}

.fm-sidebar-item {
    padding: 6px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.fm-sidebar-item.active {
    background: rgba(100, 130, 255, 0.15);
    color: #88aaff;
    border-right: 2px solid #6688ff;
}

.fm-sidebar-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 14px;
}

.fm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* List view */
.file-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.file-list.list-view .file-item {
    flex-direction: row;
    align-items: center;
    padding: 4px 10px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 10px;
    min-height: 32px;
}

.file-list.list-view .file-item-icon {
    font-size: 20px;
    margin-bottom: 0;
    min-width: 28px;
    text-align: center;
}

.file-list.list-view .file-item-name {
    flex: 1;
    text-align: left;
    font-size: 13px;
}

.file-list.list-view .file-item-meta {
    display: none;
}

.file-item-size,
.file-item-date,
.file-item-type {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    min-width: 70px;
    text-align: right;
}

.file-item-type {
    min-width: 60px;
}

/* List view header */
.fm-list-header {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.fm-list-header span {
    cursor: pointer;
}

.fm-list-header span:hover {
    color: rgba(255, 255, 255, 0.8);
}

.fm-list-header .col-icon { min-width: 28px; }
.fm-list-header .col-name { flex: 1; }
.fm-list-header .col-size { min-width: 70px; text-align: right; }
.fm-list-header .col-date { min-width: 70px; text-align: right; }
.fm-list-header .col-type { min-width: 60px; text-align: right; }

/* View toggle button */
.fm-view-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 3px 8px;
    cursor: pointer;
    margin-left: 4px;
}

.fm-view-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Toolbar separator */
.fm-toolbar-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
    align-self: center;
}

.file-list.list-view .file-item:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.06);
}

.file-item:focus-visible {
    outline: 2px solid rgba(102, 136, 255, 0.5);
    outline-offset: -2px;
}

/* Breadcrumb bar background */
.file-manager-path {
    background: rgba(0, 0, 0, 0.12);
}

/* Grid: slightly wider items */
.file-list:not(.list-view) {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

/* Drag ghost styling */
.fm-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(30, 30, 50, 0.9);
    border: 1px solid rgba(100, 130, 255, 0.5);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -100%);
}

/* Terminal */
.terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.terminal-header {
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
}

.terminal-header-info {
    color: rgba(255,255,255,0.7);
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    color: #00ff00;
    font-size: 14px;
    line-height: 1.5;
}

.terminal-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-text {
    font-family: inherit;
    white-space: pre;
}

.terminal-prompt {
    color: #00ff00;
}

.terminal-command {
    color: #ffffff;
}

.terminal-error {
    color: #ff5555;
}

.terminal-system {
    color: #00aaff;
}

.terminal-input-line {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.terminal-input-prompt {
    color: #00ff00;
    margin-right: 8px;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.terminal-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Terminal xterm.js */
.terminal-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e2e;
}

.terminal-toolbar {
    padding: 5px 10px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
}

.terminal-xterm {
    flex: 1;
    overflow: hidden;
    padding: 4px;
}

.terminal-xterm .xterm {
    height: 100%;
}

/* Text Editor */
.text-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.editor-filename {
    flex: 1;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

.editor-content {
    flex: 1;
    padding: 10px;
}

.editor-textarea {
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: white;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

/* Task Manager */
.task-manager {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.task-manager-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tab {
    padding: 12px 24px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.tab.active {
    color: white;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.task-manager-content {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.process-table {
    width: 100%;
    border-collapse: collapse;
}

.process-table th {
    text-align: left;
    padding: 10px;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.process-table td {
    padding: 10px;
    color: white;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.process-table tr:hover {
    background: rgba(255,255,255,0.05);
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 10px;
}

.performance-card {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.performance-card h3 {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-value {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.performance-detail {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: 8px;
}

.performance-detail span {
    color: white;
    font-weight: 500;
}

.performance-card canvas {
    width: 100%;
    margin-top: 10px;
    border-radius: 4px;
}

/* Browser */
.browser {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.browser-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    align-items: center;
}

.browser-url {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: white;
    outline: none;
    font-size: 13px;
}

.browser-url:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.browser-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.browser-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.browser-iframe.hidden {
    display: none;
}

.browser-shadow-container {
    width: 100%;
    height: 100%;
    background: white;
    overflow: auto;
}

.browser-shadow-container.hidden {
    display: none;
}

/* Styles for Shadow DOM content */
.shadow-content-wrapper {
    min-height: 100%;
}

.loading-placeholder,
.blank-page,
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: #666;
}

.error-page {
    flex-direction: column;
    color: #c33;
}

.error-page h2 {
    margin: 0 0 20px 0;
    color: #a00;
}

.error-page p {
    margin: 10px 0;
    color: #666;
}

.browser-statusbar {
    padding: 4px 12px;
    background: rgba(30, 30, 30, 0.95);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.browser-bookmarks-bar {
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.85);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.browser-bookmarks-bar.hidden {
    display: none;
}

.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(20, 20, 20, 0.5);
}

.bookmarks-title {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
}

.bookmarks-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.bookmarks-search {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: white;
    font-size: 11px;
    outline: none;
    width: 150px;
    transition: all 0.2s;
}

.bookmarks-search:focus {
    border-color: #667eea;
    background: rgba(0, 0, 0, 0.5);
}

.bookmark-action-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    transition: all 0.2s;
}

.bookmark-action-btn:hover {
    background: rgba(255,255,255,0.2);
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
}

.bookmark-folder {
    margin-bottom: 8px;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.folder-header:hover {
    background: rgba(255,255,255,0.1);
}

.folder-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    width: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.folder-name {
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

.folder-count {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.folder-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-header:hover .folder-actions {
    opacity: 1;
}

.folder-action-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: all 0.2s;
}

.folder-action-btn:hover {
    color: white;
    transform: scale(1.2);
}

.folder-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 0 28px;
}

.folder-content.hidden {
    display: none;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}

.bookmark-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #667eea;
    transform: translateX(2px);
}

.bookmark-item.dragging {
    opacity: 0.5;
    cursor: move;
}

.bookmark-favicon {
    font-size: 14px;
    flex-shrink: 0;
}

.bookmark-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.bookmark-item:hover .bookmark-actions {
    opacity: 1;
}

.bookmark-action-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    transition: all 0.2s;
}

.bookmark-action-btn:hover {
    color: white;
    transform: scale(1.2);
}

.browser-loading {
    height: 3px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.browser-loading.hidden {
    display: none;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: loadingProgress 1.5s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* WebApp */
.webapp {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.webapp-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    align-items: center;
}

.webapp-url-display {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: white;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.webapp-loading {
    height: 3px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.webapp-loading.hidden {
    display: none;
}

.webapp-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.webapp-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.webapp-statusbar {
    padding: 4px 12px;
    background: rgba(30, 30, 30, 0.95);
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* Settings */
.settings {
    display: flex;
    height: 100%;
}

.settings-sidebar {
    width: 200px;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
}

.settings-menu-item {
    padding: 10px 12px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.15s;
}

.settings-menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.settings-menu-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.settings-content {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    margin-bottom: 8px;
}

.settings-option-label {
    color: white;
    font-size: 14px;
}

.settings-option-description {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: 4px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-switch-handle {
    transform: translateX(20px);
}

/* Settings - Select */
.settings-select {
    padding: 6px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.2s;
}

.settings-select:focus,
.settings-select:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
}

.settings-select option {
    background: #222;
    color: white;
}

/* Settings - Info grid */
.settings-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.settings-info-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px 14px;
}

.settings-info-label {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.settings-info-value {
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Settings - Status dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online  { background: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,0.6); }
.status-dot.offline { background: #f44336; }

/* Settings - Storage bar */
.settings-storage-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.settings-storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #667eea);
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 2px;
}

/* Settings - Accent swatches */
.accent-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.accent-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.18s;
    outline: none;
    flex-shrink: 0;
}

.accent-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.4);
}

.accent-swatch.active {
    border-color: white;
    transform: scale(1.2);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}

/* Settings - Slider */
.settings-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color, #667eea);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
    transition: transform 0.15s;
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.settings-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color, #667eea);
    cursor: pointer;
    border: none;
}

/* Settings - Danger button */
.settings-btn-danger {
    color: #ff6b6b;
    border: 1px solid rgba(255,100,100,0.2);
}

.settings-btn-danger:hover {
    background: rgba(255,80,80,0.15);
    border-color: rgba(255,100,100,0.4);
}

/* Settings - About hero */
.settings-about-hero {
    text-align: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(102,126,234,0.15) 0%, rgba(118,75,162,0.1) 100%);
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 10px;
    margin-bottom: 8px;
}

.settings-about-logo {
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.settings-about-version {
    font-size: 14px;
    color: var(--accent-color, #667eea);
    font-weight: 500;
    margin-bottom: 4px;
}

.settings-about-tagline {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* Settings - Tech list */
.settings-tech-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-tech-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color, #667eea);
}

.settings-tech-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.settings-tech-desc {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

/* NKS Browser - Remote Browser */
.nks-browser {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a1a;
}

.nks-browser-toolbar {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.nks-browser-url {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    outline: none;
}

.nks-browser-url:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
}

.nks-browser-bookmarks-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    overflow-x: auto;
}

.bookmarks-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.bookmarks-list {
    display: flex;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bookmark-name {
    color: white;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-delete {
    padding: 0 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
}

.bookmark-delete:hover {
    color: #ff4444;
}

.nks-browser-loading {
    height: 3px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.nks-browser-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.nks-browser-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    image-rendering: auto;
}

.nks-browser-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.4);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.placeholder-text {
    font-size: 16px;
}

.nks-browser-statusbar {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    height: 28px;
}

.browser-url-preview {
    color: #667eea;
}

/* ===================== Image Viewer ===================== */
.image-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a1e;
    user-select: none;
}

.iv-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(30, 30, 35, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.iv-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.iv-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
    color: white;
}

.iv-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
    flex-shrink: 0;
}

.iv-zoom-level {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.iv-filename {
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.iv-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, #222 25%, transparent 25%),
        linear-gradient(-45deg, #222 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #222 75%),
        linear-gradient(-45deg, transparent 75%, #222 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-color: #2a2a2a;
}

.iv-canvas-container:active {
    cursor: grabbing;
}

.iv-image {
    max-width: none;
    max-height: none;
    position: absolute;
    transform-origin: center center;
    pointer-events: none;
    transition: transform 0.05s linear;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

.iv-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
}

.iv-placeholder-icon {
    font-size: 64px;
    opacity: 0.2;
}

.iv-placeholder-text {
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
    text-align: center;
}

/* ===================== Calculator ===================== */
.calculator {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1c1c1e;
    overflow: hidden;
}

.calc-display {
    flex-shrink: 0;
    padding: 16px 20px 12px;
    background: #1c1c1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
}

.calc-history {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    min-height: 18px;
    text-align: right;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.calc-value {
    color: white;
    font-size: 36px;
    font-weight: 300;
    text-align: right;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    transition: font-size 0.1s;
}

.calc-buttons {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px;
}

.calc-btn {
    background: #2c2c2e;
    color: white;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.1s, transform 0.08s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.calc-btn:hover {
    background: #3a3a3c;
}

.calc-btn:active {
    transform: scale(0.93);
    background: #48484a;
}

.calc-btn.func {
    background: #636366;
    color: white;
    font-size: 18px;
}

.calc-btn.func:hover {
    background: #7c7c80;
}

.calc-btn.op {
    background: #ff9f0a;
    color: white;
    font-size: 24px;
    font-weight: 500;
}

.calc-btn.op:hover {
    background: #ffa826;
}

.calc-btn.op.active {
    background: white;
    color: #ff9f0a;
}

.calc-btn.equals {
    background: #ff9f0a;
    color: white;
    font-size: 24px;
    font-weight: 500;
}

.calc-btn.equals:hover {
    background: #ffa826;
}

.calc-btn.zero {
    grid-column: span 2;
    justify-content: flex-start;
    padding-left: 28px;
}

.calc-btn.zero:active {
    transform: none;
}

/* ==========================================================================
   Sticky Notes
   ========================================================================== */

:root {
    --sticky-yellow: #fef08a;
    --sticky-pink:   #fda4af;
    --sticky-blue:   #93c5fd;
    --sticky-green:  #86efac;
    --sticky-purple: #d8b4fe;
    --sticky-yellow-dark: #ca8a04;
    --sticky-pink-dark:   #be185d;
    --sticky-blue-dark:   #1d4ed8;
    --sticky-green-dark:  #15803d;
    --sticky-purple-dark: #7c3aed;
}

.sticky-note {
    position: absolute;
    min-width: 160px;
    min-height: 120px;
    border-radius: 6px;
    box-shadow: 2px 4px 16px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    user-select: none;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
}

.sticky-note[data-color="yellow"] { background: var(--sticky-yellow); }
.sticky-note[data-color="pink"]   { background: var(--sticky-pink); }
.sticky-note[data-color="blue"]   { background: var(--sticky-blue); }
.sticky-note[data-color="green"]  { background: var(--sticky-green); }
.sticky-note[data-color="purple"] { background: var(--sticky-purple); }

.sticky-header {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    gap: 4px;
    cursor: move;
    background: rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.sticky-colors {
    display: flex;
    gap: 4px;
    flex: 1;
}

.sticky-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.sticky-color-dot:hover        { transform: scale(1.25); }
.sticky-color-dot.active       { box-shadow: 0 0 0 2px rgba(0,0,0,0.4); transform: scale(1.2); }
.sticky-color-dot[data-color="yellow"] { background: var(--sticky-yellow); }
.sticky-color-dot[data-color="pink"]   { background: var(--sticky-pink); }
.sticky-color-dot[data-color="blue"]   { background: var(--sticky-blue); }
.sticky-color-dot[data-color="green"]  { background: var(--sticky-green); }
.sticky-color-dot[data-color="purple"] { background: var(--sticky-purple); }

.sticky-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: rgba(0,0,0,0.45);
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.sticky-close:hover { color: rgba(0,0,0,0.85); }

.sticky-content {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0,0,0,0.8);
    outline: none;
    font-family: 'Segoe UI', sans-serif;
    overflow-y: auto;
}

.sticky-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.15) 50%);
    border-bottom-right-radius: 6px;
}

/* ==========================================================================
   Text Editor (enhanced)
   ========================================================================== */

.text-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.editor-toolbar-sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    margin: 0 2px;
}

.editor-filename {
    flex: 1;
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-button--toggle.active {
    background: rgba(102,126,234,0.4);
    border-color: rgba(102,126,234,0.6);
    color: #c5d0ff;
}

/* Find bar */
.editor-find-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.editor-find-bar.hidden { display: none; }

.editor-find-input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: white;
    padding: 3px 8px;
    font-size: 12px;
    outline: none;
    width: 160px;
}
.editor-find-input:focus { border-color: rgba(102,126,234,0.6); }

.editor-find-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: rgba(255,255,255,0.75);
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.editor-find-btn:hover { background: rgba(255,255,255,0.15); }

.editor-find-count {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    min-width: 60px;
}

.editor-find-sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.12);
    margin: 0 4px;
}

.editor-find-close {
    margin-left: auto;
}

/* Editor body */
.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane--split {
    flex: 1;
    max-width: 50%;
}

/* Line numbers */
.editor-line-numbers {
    width: 38px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.3);
    font-family: 'Consolas','Monaco','Courier New',monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 4px 10px 0;
    text-align: right;
    white-space: pre;
    overflow: hidden;
    user-select: none;
}

.editor-textarea {
    flex: 1;
    background: rgba(0,0,0,0.25);
    border: none;
    color: white;
    padding: 10px;
    font-family: 'Consolas','Monaco','Courier New',monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow-y: auto;
    tab-size: 4;
}

/* Markdown preview */
.editor-preview {
    flex: 1;
    background: rgba(15,15,20,0.7);
    border-left: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto;
}

.editor-preview.hidden { display: none; }

.editor-preview-content {
    padding: 16px 20px;
    color: rgba(255,255,255,0.88);
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.editor-preview-content h1,
.editor-preview-content h2,
.editor-preview-content h3,
.editor-preview-content h4,
.editor-preview-content h5,
.editor-preview-content h6 {
    color: #c5d0ff;
    margin: 16px 0 8px;
    font-weight: 600;
}
.editor-preview-content h1 { font-size: 1.8em; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 6px; }
.editor-preview-content h2 { font-size: 1.4em; border-bottom: 1px solid rgba(255,255,255,0.07); padding-bottom: 4px; }
.editor-preview-content h3 { font-size: 1.15em; }

.editor-preview-content p { margin: 6px 0; }
.editor-preview-content ul,
.editor-preview-content ol { margin: 6px 0; padding-left: 24px; }
.editor-preview-content li { margin: 2px 0; }

.editor-preview-content a { color: #7eb6f7; text-decoration: underline; }
.editor-preview-content a:hover { color: #aed4ff; }

.editor-preview-content blockquote {
    border-left: 3px solid rgba(102,126,234,0.5);
    margin: 8px 0;
    padding: 4px 12px;
    background: rgba(102,126,234,0.08);
    color: rgba(255,255,255,0.6);
    border-radius: 0 4px 4px 0;
}

.editor-preview-content code {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: 'Consolas','Monaco','Courier New',monospace;
    font-size: 0.9em;
    color: #f0a080;
}

.editor-preview-content pre {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 10px 0;
}

.editor-preview-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: #c8d4c0;
    font-size: 13px;
    line-height: 1.5;
}

/* Syntax highlighting tokens */
.hl-keyword { color: #c678dd; font-weight: 500; }
.hl-string { color: #98c379; }
.hl-comment { color: #5c6370; font-style: italic; }
.hl-number { color: #d19a66; }
.hl-func { color: #61afef; }

.editor-preview-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 16px 0;
}

.editor-preview-content img {
    max-width: 100%;
    border-radius: 4px;
}

.editor-preview-content strong { color: #f0e0c0; font-weight: 600; }
.editor-preview-content em     { color: #d0e8e0; font-style: italic; }

/* Status bar */
.editor-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
}

.editor-status-file {
    color: rgba(255,255,255,0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.editor-status-sep {
    color: rgba(255,255,255,0.2);
}

/* ===================== Media Player ===================== */
.mp-container {
    display: flex;
    height: 100%;
    background: #18181c;
    overflow: hidden;
    user-select: none;
}

.mp-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* --- Display area --- */
.mp-display {
    flex: 1;
    position: relative;
    background: #0d0d10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.mp-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.mp-video.hidden {
    display: none;
}

.mp-visualizer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
}

.mp-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
}

.mp-placeholder-icon {
    font-size: 56px;
    opacity: 0.15;
}

.mp-placeholder-text {
    color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
}

.mp-track-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.mp-track-title {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.mp-track-time {
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* --- Seek bar --- */
.mp-seek-row {
    flex-shrink: 0;
    padding: 6px 12px 4px;
    background: rgba(20,20,24,0.98);
}

.mp-seek-bar {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    cursor: pointer;
    transition: height 0.15s;
}

.mp-seek-bar:hover {
    height: 7px;
}

.mp-seek-buffered {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    pointer-events: none;
    width: 0;
}

.mp-seek-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    pointer-events: none;
    width: 0;
    transition: width 0.1s linear;
}

.mp-seek-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.15s;
}

.mp-seek-bar:hover .mp-seek-thumb {
    opacity: 1;
}

/* --- Controls --- */
.mp-controls {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 10px;
    background: rgba(20,20,24,0.98);
    border-top: 1px solid rgba(255,255,255,0.06);
    gap: 8px;
}

.mp-controls-left,
.mp-controls-center,
.mp-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mp-controls-center { gap: 6px; }

.mp-btn {
    padding: 5px 9px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.mp-btn:hover {
    background: rgba(102,126,234,0.25);
    border-color: rgba(102,126,234,0.5);
    color: #fff;
}

.mp-btn.active {
    background: rgba(102,126,234,0.35);
    border-color: rgba(102,126,234,0.6);
    color: #fff;
}

.mp-btn-play {
    font-size: 18px;
    padding: 5px 14px;
    background: rgba(102,126,234,0.2);
    border-color: rgba(102,126,234,0.4);
}

.mp-btn-play:hover {
    background: rgba(102,126,234,0.4);
}

.mp-btn-sm {
    padding: 2px 6px;
    font-size: 12px;
}

/* --- Volume bar --- */
.mp-volume-bar {
    position: relative;
    width: 80px;
    height: 5px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    cursor: pointer;
    margin-left: 4px;
    transition: height 0.15s;
}

.mp-volume-bar:hover {
    height: 7px;
}

.mp-volume-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    pointer-events: none;
    width: 80%;
}

.mp-volume-thumb {
    position: absolute;
    top: 50%;
    left: 80%;
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.15s;
}

.mp-volume-bar:hover .mp-volume-thumb {
    opacity: 1;
}

/* --- Playlist panel --- */
.mp-playlist-panel {
    display: flex;
    flex-direction: column;
    width: 210px;
    flex-shrink: 0;
    background: rgba(14,14,18,0.97);
    border-left: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}

.mp-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.mp-playlist-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.mp-playlist-items::-webkit-scrollbar {
    width: 4px;
}

.mp-playlist-items::-webkit-scrollbar-track {
    background: transparent;
}

.mp-playlist-items::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

.mp-playlist-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    min-width: 0;
}

.mp-playlist-item:hover {
    background: rgba(255,255,255,0.06);
}

.mp-playlist-item.active {
    background: rgba(102,126,234,0.2);
    border-left: 2px solid #667eea;
}

.mp-playlist-index {
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    min-width: 16px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.mp-playlist-name {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.mp-playlist-item.active .mp-playlist-name {
    color: #fff;
}

.mp-playlist-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 11px;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
    flex-shrink: 0;
    opacity: 0;
}

.mp-playlist-item:hover .mp-playlist-remove {
    opacity: 1;
}

.mp-playlist-remove:hover {
    color: #ff6b6b;
}

/* Theme Swatches — Settings appearance page */
.theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    width: 88px;
}

.theme-swatch:hover {
    border-color: var(--border-active);
    transform: scale(1.04);
}

.theme-swatch.active {
    border-color: var(--accent-color);
}

.theme-swatch-preview {
    width: 84px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: 0;
}

.theme-swatch-name {
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 84px;
}

.theme-swatch.active .theme-swatch-name {
    color: var(--accent-color);
    font-weight: 600;
}

.theme-swatch-badge {
    font-size: 9px;
    color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 15%, transparent);
    border-radius: 4px;
    padding: 1px 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   NKS IS Hub
   ============================================================ */

.nksis-hub {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
    font-family: inherit;
}

/* Sidebar */
.nksis-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-secondary, #16213e);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nksis-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nksis-logo-icon {
    font-size: 22px;
}

.nksis-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    letter-spacing: 0.5px;
}

.nksis-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nksis-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    color: var(--text-secondary, #888);
    font-size: 13px;
    user-select: none;
    position: relative;
}

.nksis-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e0e0e0);
}

.nksis-nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--accent-color, #667eea);
    font-weight: 600;
}

.nksis-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color, #667eea);
    border-radius: 0 2px 2px 0;
}

.nksis-nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nksis-nav-label {
    flex: 1;
}

.nksis-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nksis-connection-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-secondary, #888);
}

.nksis-conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #666;
    flex-shrink: 0;
    transition: background 0.3s;
}

.nksis-conn-dot.connected { background: #4ade80; }
.nksis-conn-dot.error { background: #f87171; }

/* Content area */
.nksis-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.nksis-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-secondary, #16213e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.nksis-toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    flex: 1;
}

.nksis-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nksis-search {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary, #e0e0e0);
    font-size: 12px;
    padding: 5px 10px;
    width: 180px;
    outline: none;
    transition: border-color 0.2s;
}

.nksis-search:focus {
    border-color: var(--accent-color, #667eea);
    background: rgba(255, 255, 255, 0.09);
}

.nksis-search::placeholder { color: rgba(255, 255, 255, 0.3); }

.nksis-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
}

/* Buttons */
.nksis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #e0e0e0);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nksis-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.nksis-btn-icon {
    padding: 5px 8px;
    font-size: 14px;
}

.nksis-btn-primary {
    background: var(--accent-color, #667eea);
    border-color: var(--accent-color, #667eea);
    color: #fff;
}

.nksis-btn-primary:hover {
    background: color-mix(in srgb, var(--accent-color, #667eea) 80%, white);
}

.nksis-btn-back {
    background: transparent;
    border-color: transparent;
    color: var(--accent-color, #667eea);
    padding: 5px 8px;
    font-size: 13px;
}

.nksis-btn-back:hover { background: rgba(102, 126, 234, 0.1); }

/* Loading & Error states */
.nksis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-secondary, #888);
    font-size: 13px;
}

.nksis-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color, #667eea);
    border-radius: 50%;
    animation: nksis-spin 0.7s linear infinite;
}

@keyframes nksis-spin { to { transform: rotate(360deg); } }

.nksis-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
}

.nksis-error-icon { font-size: 40px; }

.nksis-error-message {
    color: var(--text-secondary, #888);
    font-size: 13px;
    max-width: 320px;
}

.nksis-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, #888);
    font-size: 13px;
}

/* List header */
.nksis-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.nksis-list-count {
    font-size: 11px;
    color: var(--text-secondary, #888);
}

/* Tags & Badges */
.nksis-tag {
    display: inline-block;
    padding: 2px 7px;
    background: rgba(102, 126, 234, 0.15);
    color: var(--accent-color, #667eea);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.nksis-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nksis-badge-success { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.nksis-badge-warning { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.nksis-badge-danger  { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.nksis-badge-info    { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }

.nksis-date {
    font-size: 11px;
    color: var(--text-secondary, #888);
}

.nksis-positive { color: #4ade80; }
.nksis-negative { color: #f87171; }

/* Pagination */
.nksis-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 0 4px;
}

.nksis-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #888);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nksis-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary, #e0e0e0);
}

.nksis-page-btn.active {
    background: var(--accent-color, #667eea);
    border-color: var(--accent-color, #667eea);
    color: #fff;
    font-weight: 600;
}

.nksis-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Dashboard */
.nksis-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.nksis-card {
    background: var(--bg-secondary, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s, transform 0.15s;
}

.nksis-card-clickable {
    cursor: pointer;
}

.nksis-card-clickable:hover {
    border-color: var(--accent-color, #667eea);
    transform: translateY(-2px);
}

.nksis-card-icon { font-size: 28px; }

.nksis-card-title {
    font-size: 12px;
    color: var(--text-secondary, #888);
    margin-bottom: 3px;
}

.nksis-card-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
}

/* Wiki */
.nksis-wiki-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nksis-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.nksis-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.07);
}

.nksis-item-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.nksis-item-body { flex: 1; min-width: 0; }

.nksis-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.nksis-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.nksis-item-arrow {
    color: var(--text-secondary, #888);
    font-size: 18px;
    flex-shrink: 0;
}

/* Wiki detail */
.nksis-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nksis-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nksis-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    margin: 0 0 8px;
}

.nksis-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.nksis-wiki-content.nksis-prose {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary, #e0e0e0);
}

.nksis-prose h1, .nksis-prose h2, .nksis-prose h3 {
    color: var(--text-primary, #e0e0e0);
    margin: 16px 0 8px;
}

.nksis-prose p { margin: 0 0 10px; }
.nksis-prose ul, .nksis-prose ol { padding-left: 20px; margin: 0 0 10px; }
.nksis-prose li { margin-bottom: 4px; }

.nksis-prose code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.nksis-prose a {
    color: var(--accent-color, #667eea);
    text-decoration: none;
}

.nksis-prose a:hover { text-decoration: underline; }

/* Contacts */
.nksis-contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.nksis-contact-card {
    background: var(--bg-secondary, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    padding: 14px;
    display: flex;
    gap: 12px;
    transition: border-color 0.2s;
}

.nksis-contact-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.nksis-contact-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #667eea), #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.nksis-contact-info { flex: 1; min-width: 0; }

.nksis-contact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.nksis-contact-company {
    font-size: 11px;
    color: var(--accent-color, #667eea);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nksis-contact-detail {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.nksis-detail-icon { font-size: 12px; }

.nksis-contact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

/* Tables */
.nksis-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.nksis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.nksis-table thead tr {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nksis-table th {
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.nksis-th-right { text-align: right; }

.nksis-table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s;
}

.nksis-table-row:hover { background: rgba(255, 255, 255, 0.03); }
.nksis-table-row:last-child { border-bottom: none; }
.nksis-row-muted { opacity: 0.55; }

.nksis-table td {
    padding: 9px 12px;
    color: var(--text-primary, #e0e0e0);
    vertical-align: middle;
}

.nksis-td-name { max-width: 220px; }

.nksis-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.nksis-td-mono { font-family: monospace; }

/* Ads */
.nksis-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.nksis-ad-card {
    background: var(--bg-secondary, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.nksis-ad-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.nksis-ad-image {
    width: 100%;
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.04);
}

.nksis-ad-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.15);
}

.nksis-ad-body { padding: 10px; }

.nksis-ad-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nksis-ad-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.nksis-ad-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-color, #667eea);
}

.nksis-ad-platform {
    font-size: 10px;
    color: var(--text-secondary, #888);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
}

.nksis-ad-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

/* Crypto */
.nksis-crypto-symbol {
    font-weight: 700;
    color: var(--accent-color, #667eea);
    font-family: monospace;
}

/* NKS IS - Filter tabs (source tabs with count badges) */
.nksis-filter-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nksis-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary, #888);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nksis-filter-tab:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
    color: var(--text-primary, #e0e0e0);
}

.nksis-filter-tab.active {
    background: var(--accent-color, #667eea);
    border-color: var(--accent-color, #667eea);
    color: #fff;
}

.nksis-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.nksis-filter-tab.active .nksis-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* NKS IS - Wiki view toggle */
.nksis-view-toggle {
    display: flex;
    gap: 4px;
}

.nksis-btn-sm {
    padding: 3px 8px;
    font-size: 11px;
}

/* NKS IS - Wiki tree view */
.nksis-wiki-tree-view {
    padding: 4px 0;
}

.nksis-wiki-tree-view.hidden,
.nksis-wiki-items.hidden {
    display: none;
}

.nksis-wiki-tree-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nksis-wiki-tree-list .nksis-wiki-tree-list {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: 10px;
}

.nksis-wiki-tree-node {
    margin: 1px 0;
}

.nksis-wiki-tree-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #e0e0e0);
    transition: background 0.12s;
}

.nksis-wiki-tree-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nksis-tree-toggle {
    font-size: 9px;
    color: var(--text-secondary, #888);
    width: 12px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.nksis-tree-spacer {
    width: 12px;
    flex-shrink: 0;
}

.nksis-tree-icon {
    flex-shrink: 0;
}

.nksis-tree-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* NKS IS - Wiki content: texy preformatted */
.nksis-texy-content {
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-secondary, #aaa);
}

/* NKS IS - Wiki markdown code blocks */
.nksis-code-block {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    margin: 10px 0;
}

.nksis-code-block code {
    font-family: monospace;
    font-size: 12px;
    color: #a8d8ea;
    background: none;
    padding: 0;
}

.nksis-md-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

.nksis-md-table th,
.nksis-md-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* NKS IS - Crypto multi-stat summary */
.nksis-crypto-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-secondary, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
}

.nksis-crypto-stat {
    flex: 1;
    min-width: 120px;
}

.nksis-crypto-stat-label {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-bottom: 4px;
}

.nksis-crypto-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
}

.nksis-profit { color: #4ade80; }
.nksis-loss   { color: #f87171; }
.nksis-muted  { color: var(--text-secondary, #888); font-size: 14px; font-weight: 400; }

/* ==========================================================================
   Code Editor — VS Code-inspired layout
   ========================================================================== */

.code-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* --- Menu Bar --- */
.ce-menubar {
    display: flex;
    align-items: center;
    height: 30px;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
    user-select: none;
    position: relative;
    z-index: 100;
}

.ce-menu {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    color: #cdd6f4;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s;
}

.ce-menu:hover,
.ce-menu--active {
    background: rgba(255, 255, 255, 0.08);
}

.ce-menubar-spacer {
    flex: 1;
}

.ce-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-left: 1px solid #313244;
    border-right: 1px solid #313244;
    font-size: 12px;
    color: #cdd6f4;
    max-width: 200px;
    overflow: hidden;
}

.ce-tab-icon { font-size: 11px; }

.ce-tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-tab-dirty {
    color: #f9e2af;
    font-size: 14px;
    line-height: 1;
}

.ce-lang-select {
    background: transparent;
    border: none;
    border-left: 1px solid #313244;
    color: #a6adc8;
    padding: 0 10px;
    font-size: 12px;
    height: 100%;
    outline: none;
    cursor: pointer;
}

.ce-lang-select:focus { color: #cdd6f4; }

.ce-lang-select option { background: #1e1e2e; }

/* --- Dropdown menus --- */
.ce-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    min-width: 220px;
    padding: 4px 0;
    font-size: 12px;
}

.ce-dd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    color: #cdd6f4;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.ce-dd-item:hover { background: rgba(137, 180, 250, 0.15); }

.ce-dd-shortcut {
    color: #585b70;
    font-size: 11px;
    margin-left: 20px;
}

.ce-dd-sep {
    height: 1px;
    background: #313244;
    margin: 4px 0;
}

/* --- Action Bar --- */
.ce-action-bar {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 6px;
    gap: 2px;
    background: #1e1e2e;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
}

.ce-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    background: none;
    border: none;
    border-radius: 3px;
    color: #a6adc8;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    padding: 0;
}

.ce-action:hover { background: rgba(255, 255, 255, 0.08); color: #cdd6f4; }

.ce-run-btn { color: #a6e3a1; }
.ce-run-btn:hover { background: rgba(166, 227, 161, 0.12); color: #a6e3a1; }

.ce-wat-action { color: #f9e2af; }
.ce-wat-action:hover { background: rgba(249, 226, 175, 0.12); color: #f9e2af; }

.ce-action-sep {
    width: 1px;
    height: 16px;
    background: #313244;
    margin: 0 3px;
}

.ce-action-spacer { flex: 1; }

/* --- Main area: sidebar + editor/output --- */
.ce-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* --- Sidebar --- */
.ce-sidebar {
    display: flex;
    flex-direction: column;
    width: 200px;
    min-width: 200px;
    background: #181825;
    border-right: 1px solid #313244;
    overflow: hidden;
    flex-shrink: 0;
}

.ce-sidebar-header {
    padding: 8px 12px 4px;
    flex-shrink: 0;
}

.ce-sidebar-title {
    font-size: 10px;
    font-weight: 700;
    color: #585b70;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.ce-sidebar-tree {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    padding: 2px 0 8px;
}

.ce-sidebar-dir {
    padding: 3px 12px;
    font-size: 11px;
    color: #6c7086;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ce-sidebar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    font-size: 12px;
    color: #a6adc8;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.1s;
}

.ce-sidebar-item:hover { background: rgba(255,255,255,0.05); color: #cdd6f4; }

.ce-sidebar-item--active {
    background: rgba(137, 180, 250, 0.15);
    color: #89b4fa;
}

.ce-sidebar-icon { font-size: 11px; flex-shrink: 0; }

.ce-sidebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ce-sidebar-empty {
    padding: 10px 12px;
    font-size: 11px;
    color: #45475a;
    font-style: italic;
}

/* --- Content column: editor + output --- */
.ce-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

/* Editor container — CodeMirror fills this */
.ce-editor-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.ce-editor-container .CodeMirror {
    height: 100%;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.55;
}

.ce-editor-container .CodeMirror-scroll { height: 100%; }

/* CodeMirror dialog (find/replace) */
.ce-editor-container .CodeMirror-dialog {
    background: rgba(24, 24, 37, 0.97);
    border-bottom: 1px solid #313244;
    padding: 5px 10px;
    font-size: 12px;
    color: #cdd6f4;
}

.ce-editor-container .CodeMirror-dialog input {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid #45475a;
    border-radius: 3px;
    color: #cdd6f4;
    padding: 2px 7px;
    outline: none;
    margin: 0 4px;
}

.ce-editor-container .CodeMirror-dialog input:focus { border-color: #89b4fa; }

/* Output resize handle */
.ce-output-resizer {
    height: 4px;
    background: #181825;
    border-top: 1px solid #313244;
    cursor: ns-resize;
    flex-shrink: 0;
    transition: background 0.15s;
}

.ce-output-resizer:hover { background: rgba(137, 180, 250, 0.2); }

/* Output panel */
.ce-output-panel {
    display: flex;
    flex-direction: column;
    background: #11111b;
    border-top: 1px solid #313244;
    flex-shrink: 0;
    overflow: hidden;
    height: 160px;
}

.ce-output-header {
    display: flex;
    align-items: center;
    padding: 3px 10px;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
    gap: 8px;
}

.ce-output-title {
    font-size: 10px;
    font-weight: 700;
    color: #585b70;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.ce-output-clear {
    background: none;
    border: 1px solid #45475a;
    border-radius: 3px;
    color: #585b70;
    font-size: 11px;
    padding: 1px 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.ce-output-clear:hover { background: rgba(255,255,255,0.06); color: #a6adc8; }

.ce-output {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.ce-out-line {
    padding: 1px 0;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.ce-out-time {
    color: #45475a;
    font-size: 10px;
    flex-shrink: 0;
    min-width: 60px;
}

.ce-out-log    { color: #cdd6f4; }
.ce-out-info   { color: #89dceb; }
.ce-out-warn   { color: #f9e2af; }
.ce-out-error  { color: #f38ba8; }
.ce-out-result { color: #a6e3a1; font-style: italic; }
.ce-out-muted  { color: #45475a; font-style: italic; }

/* --- Status Bar --- */
.ce-statusbar {
    display: flex;
    align-items: center;
    gap: 0;
    height: 22px;
    padding: 0 10px;
    background: #11111b;
    border-top: 1px solid #313244;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    flex-shrink: 0;
}

.ce-status-position { color: #a6adc8; padding-right: 8px; }

.ce-status-sep {
    color: #313244;
    padding: 0 6px;
}

.ce-status-encoding { color: #585b70; }

.ce-status-lang { color: #89dceb; }

.ce-statusbar-spacer { flex: 1; }

.ce-status-file {
    color: #585b70;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
    direction: rtl;
    text-align: right;
}

/* Python REPL */
.python-repl {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e2e;
    font-family: 'Consolas', 'Courier New', monospace;
}

.py-toolbar {
    padding: 6px 10px;
    background: #181825;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
}

.py-status {
    font-size: 12px;
    color: #a6adc8;
    flex: 1;
}

.py-btn {
    background: #45475a;
    color: #cdd6f4;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.py-btn:hover {
    background: #585b70;
}

.py-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.py-stdout { color: #a6e3a1; }
.py-stderr { color: #f38ba8; }
.py-input  { color: #cdd6f4; }
.py-info   { color: #89b4fa; }

.py-input-line {
    display: flex;
    padding: 6px 10px;
    background: #181825;
    border-top: 1px solid #313244;
    align-items: center;
    flex-shrink: 0;
}

.py-prompt {
    color: #89b4fa;
    margin-right: 8px;
    font-weight: bold;
    user-select: none;
}

.py-input-line input.py-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #cdd6f4;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.py-input-line input.py-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   VPN Client
   ============================================================ */

.vpn-client {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

/* Header */
.vpn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(40,40,55,0.98) 0%, rgba(30,30,45,0.98) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.25);
    flex-shrink: 0;
}

.vpn-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vpn-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.3);
    transition: background 0.3s, box-shadow 0.3s;
}

.vpn-status-dot.connected {
    background: #4caf50;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.25), 0 0 10px rgba(76,175,80,0.4);
}

.vpn-status-dot.disconnected {
    background: rgba(255,255,255,0.25);
}

.vpn-status-dot.connecting {
    background: #ff9800;
    animation: vpn-pulse 1s ease-in-out infinite;
}

@keyframes vpn-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.vpn-status-text {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}

/* Body (list + detail) */
.vpn-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Connections list */
.vpn-connections-list {
    height: 100%;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vpn-empty {
    padding: 32px 16px;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 13px;
}

.vpn-connection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s;
}

.vpn-connection-item:hover {
    background: rgba(102,126,234,0.08);
    border-color: rgba(102,126,234,0.25);
}

.vpn-conn-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.vpn-conn-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.vpn-conn-details {
    min-width: 0;
}

.vpn-conn-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.vpn-conn-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vpn-conn-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vpn-conn-type-badge.wireguard {
    background: rgba(102,126,234,0.2);
    color: #89b4fa;
    border: 1px solid rgba(102,126,234,0.3);
}

.vpn-conn-type-badge.socks5 {
    background: rgba(255,152,0,0.15);
    color: #ffb74d;
    border: 1px solid rgba(255,152,0,0.25);
}

.vpn-conn-endpoint {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-family: 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.vpn-conn-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vpn-conn-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.vpn-mini-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vpn-mini-dot.connected   { background: #4caf50; }
.vpn-mini-dot.connecting  { background: #ff9800; animation: vpn-pulse 1s infinite; }
.vpn-mini-dot.disconnected { background: rgba(255,255,255,0.2); }

/* Buttons */
.vpn-btn {
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(102,126,234,0.18);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(102,126,234,0.3);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
}

.vpn-btn:hover {
    background: rgba(102,126,234,0.32);
    border-color: rgba(102,126,234,0.5);
}

.vpn-btn:active {
    transform: scale(0.97);
}

.vpn-btn.danger {
    background: rgba(244,67,54,0.18);
    border-color: rgba(244,67,54,0.3);
    color: #ef9a9a;
}

.vpn-btn.danger:hover {
    background: rgba(244,67,54,0.32);
    border-color: rgba(244,67,54,0.5);
}

.vpn-icon-btn {
    padding: 6px 9px;
    font-size: 14px;
    line-height: 1;
}

/* Details panel */
.vpn-details {
    height: 100%;
    overflow: hidden;
    flex-direction: column;
}

.vpn-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.vpn-detail-name {
    font-weight: 600;
    font-size: 14px;
}

.vpn-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Form */
.vpn-form {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vpn-form-section {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
}

.vpn-form-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 10px;
}

.vpn-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.vpn-form-row-full {
    flex-direction: column;
    align-items: stretch;
}

.vpn-form-row-full .vpn-form-label {
    width: auto;
}

.vpn-form-label {
    width: 110px;
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    text-align: right;
}

.vpn-form-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: rgba(255,255,255,0.9);
    padding: 5px 9px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.vpn-form-input:focus {
    border-color: rgba(102,126,234,0.6);
    background: rgba(102,126,234,0.08);
}

.vpn-form-input::placeholder {
    color: rgba(255,255,255,0.22);
}

textarea.vpn-form-input {
    resize: vertical;
    min-height: 90px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.5;
}

.vpn-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* Log panel */
.vpn-log {
    flex-shrink: 0;
    height: 130px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,10,18,0.7);
}

.vpn-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.vpn-log-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    transition: color 0.15s;
}

.vpn-log-clear:hover {
    color: rgba(255,255,255,0.7);
}

.vpn-log-output {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
}

.vpn-log-line {
    display: flex;
    gap: 8px;
}

.vpn-log-time {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    user-select: none;
}

.vpn-log-msg {
    color: rgba(255,255,255,0.72);
    word-break: break-word;
}


/* ============================================================
   SQL Client
   ============================================================ */

.sql-client {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    overflow: hidden;
    position: relative;
}

.sql-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(30, 30, 50, 0.95);
    border-bottom: 1px solid rgba(102, 126, 234, 0.25);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sql-toolbar-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.sql-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 5px;
    color: var(--text-primary, #e0e0e0);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.sql-btn:hover { background: rgba(102, 126, 234, 0.28); border-color: rgba(102, 126, 234, 0.55); }
.sql-btn:active { background: rgba(102, 126, 234, 0.4); }
.sql-btn-icon { font-size: 14px; line-height: 1; }

.sql-db-name {
    margin-left: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sql-body { display: flex; flex: 1; overflow: hidden; }

.sql-sidebar {
    width: 180px;
    min-width: 130px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    background: rgba(20, 20, 38, 0.7);
    overflow: hidden;
}

.sql-sidebar-title {
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    flex-shrink: 0;
}

.sql-tables-list { flex: 1; overflow-y: auto; padding: 6px 0; }

.sql-sidebar-group {
    padding: 4px 12px 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

.sql-table-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}
.sql-table-item:hover { background: rgba(102, 126, 234, 0.15); color: #fff; }
.sql-table-item:active { background: rgba(102, 126, 234, 0.3); }
.sql-table-icon { font-size: 13px; flex-shrink: 0; }
.sql-table-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sql-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.sql-main { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.sql-query-area {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.sql-query {
    width: 100%;
    min-height: 110px;
    max-height: 220px;
    resize: vertical;
    background: rgba(15, 15, 28, 0.85);
    color: #c9d1d9;
    border: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.55;
    outline: none;
    tab-size: 4;
    box-sizing: border-box;
}
.sql-query::placeholder { color: rgba(255, 255, 255, 0.2); }
.sql-query:focus {
    background: rgba(18, 18, 35, 0.95);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.3);
}

.sql-query-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(22, 22, 42, 0.9);
}

.sql-run-btn {
    padding: 5px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.15s, transform 0.1s;
}
.sql-run-btn:hover { opacity: 0.9; }
.sql-run-btn:active { transform: scale(0.97); }

.sql-clear-btn,
.sql-history-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.sql-clear-btn:hover,
.sql-history-btn:hover { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.9); }

.sql-results { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.sql-results-info {
    padding: 5px 14px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(20, 20, 38, 0.6);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    flex-shrink: 0;
    min-height: 24px;
}

.sql-results-table { flex: 1; overflow: auto; }

.sql-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.sql-result-table thead { position: sticky; top: 0; z-index: 1; }
.sql-result-table th {
    padding: 7px 12px;
    background: rgba(40, 40, 65, 0.98);
    color: rgba(102, 126, 234, 0.9);
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sql-result-table td {
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sql-result-table tbody tr:hover td { background: rgba(102, 126, 234, 0.08); }
.sql-result-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.sql-result-table tbody tr:nth-child(even):hover td { background: rgba(102, 126, 234, 0.08); }

.sql-null { color: rgba(255, 255, 255, 0.3) !important; font-style: italic; font-size: 11px; }
.sql-empty-row {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    padding: 20px !important;
}

.sql-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 14px;
    padding: 10px 14px;
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    border-radius: 6px;
    color: #ff9090;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.sql-error-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.sql-statusbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 3px 12px;
    background: rgba(20, 20, 38, 0.95);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    min-height: 22px;
}
.sql-status { flex: 1; }
.sql-timing { color: rgba(102, 234, 150, 0.7); font-weight: 500; }

.sql-history-panel {
    position: absolute;
    top: 40px;
    right: 0;
    width: 380px;
    max-height: 320px;
    background: rgba(28, 28, 52, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 6px 0 0 6px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
}
.sql-history-panel.hidden { display: none; }

.sql-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}
.sql-history-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.12s;
}
.sql-history-close:hover { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }
.sql-history-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.sql-history-item {
    display: flex;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sql-history-item:hover { background: rgba(102, 126, 234, 0.12); }
.sql-history-num { color: rgba(255, 255, 255, 0.25); font-size: 11px; flex-shrink: 0; min-width: 22px; padding-top: 1px; }
.sql-history-text { font-size: 12px; color: rgba(255, 255, 255, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sql-ctx-menu {
    position: fixed;
    background: rgba(28, 28, 52, 0.98);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    min-width: 240px;
    padding: 4px 0;
    font-size: 12px;
}
.sql-ctx-item {
    padding: 7px 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sql-ctx-item:hover { background: rgba(102, 126, 234, 0.2); color: #fff; }
.sql-ctx-danger { color: rgba(255, 100, 100, 0.8); }
.sql-ctx-danger:hover { background: rgba(255, 80, 80, 0.15); color: #ff9090; }
.sql-ctx-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 3px 0; }

.sql-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sql-dialog {
    background: rgba(28, 28, 52, 0.99);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    padding: 22px 26px;
    min-width: 420px;
    max-width: 540px;
}
.sql-dialog-title { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.9); margin-bottom: 16px; }
.sql-dialog-label { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-bottom: 6px; }
.sql-dialog-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 15, 28, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.sql-dialog-input:focus { border-color: rgba(102, 126, 234, 0.7); box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15); }
.sql-dialog-hint { margin-top: 5px; font-size: 11px; color: rgba(255, 255, 255, 0.3); }
.sql-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sql-dialog-cancel {
    padding: 7px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.sql-dialog-cancel:hover { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.9); }
.sql-dialog-ok {
    padding: 7px 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

/* ============================================================
   Network Monitor
   ============================================================ */

.net-monitor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-secondary, #1e1e2e);
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    overflow: hidden;
}

/* --- Tabs --- */
.net-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 10px 0;
    background: var(--bg-tertiary, #16161e);
    border-bottom: 1px solid rgba(102, 126, 234, 0.25);
    flex-shrink: 0;
}

.net-tab {
    padding: 7px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 4px 4px 0 0;
}

.net-tab:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
}

.net-tab.active {
    color: #fff;
    border-bottom-color: #667eea;
    background: rgba(102,126,234,0.12);
}

/* --- Content area --- */
.net-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Common loading / error / empty --- */
.net-loading,
.net-error,
.net-empty {
    padding: 24px;
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-style: italic;
}
.net-error { color: #f87171; }

/* ---- Monitor tab ---- */
.net-monitor-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.net-stat-cards {
    display: flex;
    gap: 10px;
    padding: 14px 14px 10px;
    flex-shrink: 0;
}

.net-stat-card {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 0;
}

.net-stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.net-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.net-stat-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.net-charts {
    display: flex;
    gap: 10px;
    padding: 0 14px 10px;
    flex: 1;
    min-height: 0;
}

.net-chart-wrap {
    flex: 1;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.net-chart-title {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.net-chart-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.net-monitor-status {
    padding: 6px 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

/* ---- Interfaces tab ---- */
.net-ifaces {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.net-iface-count {
    padding: 6px 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

/* ---- Connections tab ---- */
.net-conn-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.net-conn-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.net-search {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.net-search:focus { border-color: #667eea; }

.net-btn {
    padding: 6px 14px;
    background: rgba(102,126,234,0.25);
    border: 1px solid rgba(102,126,234,0.45);
    border-radius: 5px;
    color: #a5b4fc;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.net-btn:hover { background: rgba(102,126,234,0.4); }

.net-conn-count {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
}

/* ---- Shared table styles ---- */
.net-table-wrap {
    flex: 1;
    overflow: auto;
}

.net-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.net-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary, #16161e);
    z-index: 2;
}

.net-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    user-select: none;
}

.net-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.1s;
}

.net-table tbody tr:hover {
    background: rgba(102,126,234,0.08);
}

.net-table td {
    padding: 6px 12px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.net-mono {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}

/* Badges */
.net-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.net-badge-up   { background: rgba(52,211,153,0.18); color: #34d399; }
.net-badge-down { background: rgba(248,113,113,0.18); color: #f87171; }

/* Protocol badges */
.net-proto {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
    text-transform: uppercase;
}
.net-proto-tcp  { background: rgba(102,126,234,0.2); color: #818cf8; }
.net-proto-udp  { background: rgba(251,191,36,0.2);  color: #fbbf24; }
.net-proto-tcp6 { background: rgba(102,126,234,0.2); color: #818cf8; }
.net-proto-udp6 { background: rgba(251,191,36,0.2);  color: #fbbf24; }

/* State badges */
.net-state {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.net-state-established { background: rgba(52,211,153,0.15); color: #34d399; }
.net-state-listen      { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.net-state-close_wait  { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.net-state-time_wait   { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.net-state-syn_sent    { background: rgba(167,139,250,0.15); color: #a78bfa; }
.net-state-syn_recv    { background: rgba(167,139,250,0.15); color: #a78bfa; }
.net-state-fin_wait1,
.net-state-fin_wait2   { background: rgba(248,113,113,0.15); color: #f87171; }
.net-state-closed      { background: rgba(107,114,128,0.2);  color: #9ca3af; }

/* ---- Tools tab ---- */
.net-tools {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 14px;
    gap: 10px;
    overflow: hidden;
}

.net-tool-selector {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.net-tool-btn {
    padding: 7px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.net-tool-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.net-tool-btn.active {
    background: rgba(102,126,234,0.25);
    border-color: rgba(102,126,234,0.55);
    color: #a5b4fc;
}

.net-tool-input {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.net-host-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Consolas', monospace;
}
.net-host-input:focus { border-color: #667eea; }

.net-run-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.net-run-btn:hover    { opacity: 0.85; }
.net-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.net-clear-btn {
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.net-clear-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.net-tool-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    padding: 0 2px;
    flex-shrink: 0;
}

.net-tool-output {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #a5f3a5;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    line-height: 1.55;
}
.sql-dialog-ok:hover { opacity: 0.88; }

/* =======================================================================
   SETTINGS - Extended styles (new pages)
   ======================================================================= */

/* Page header */
.settings-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.settings-page-header h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.settings-page-icon {
    font-size: 22px;
    line-height: 1;
}

/* Sidebar icons */
.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-menu-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.settings-menu-label {
    flex: 1;
    font-size: 13px;
}

/* Option column variant */
.settings-option-col {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* Input field */
.settings-input {
    padding: 6px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.settings-input:focus,
.settings-input:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
}

/* Custom theme color pickers */
.settings-custom-theme {
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.settings-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-color-label {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    white-space: nowrap;
}

.settings-color-picker {
    width: 36px;
    height: 26px;
    padding: 1px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    cursor: pointer;
}

/* Wallpaper preview */
.settings-wallpaper-preview {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}

/* Apps page */
.settings-app-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-app-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.settings-app-row:hover {
    background: rgba(255,255,255,0.06);
}

.settings-app-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.settings-app-info {
    flex: 1;
    min-width: 0;
}

.settings-app-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.settings-app-meta {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    margin-top: 2px;
}

.settings-btn-small {
    font-size: 11px;
    padding: 4px 8px;
}

/* Keyboard shortcuts table */
.settings-shortcuts-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-shortcuts-group {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.settings-shortcuts-group-label {
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.settings-shortcut-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.settings-shortcut-row:last-child {
    border-bottom: none;
}

.settings-shortcut-keys {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--accent-color, #667eea);
    background: rgba(102,126,234,0.1);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(102,126,234,0.25);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 140px;
}

.settings-shortcut-desc {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
}

/* User profile */
.settings-user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.07) 100%);
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 10px;
    margin-bottom: 8px;
}

.settings-user-avatar {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}

.settings-user-name {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.settings-user-role {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Avatar picker */
.settings-avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-top: 8px;
}

.settings-avatar-btn {
    width: 44px;
    height: 44px;
    font-size: 24px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-avatar-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.settings-avatar-btn.active {
    border-color: var(--accent-color, #667eea);
    background: rgba(102,126,234,0.15);
    box-shadow: 0 0 8px rgba(102,126,234,0.3);
}

/* Theme swatches (already exist, but ensure grid layout) */
.theme-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.theme-swatch {
    position: relative;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    padding: 6px;
    transition: all 0.18s;
    min-width: 80px;
    text-align: center;
}

.theme-swatch:hover {
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.theme-swatch.active {
    border-color: var(--accent-color, #667eea);
    box-shadow: 0 0 10px rgba(102,126,234,0.4);
}

.theme-swatch-preview {
    display: flex;
    height: 28px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.theme-swatch-name {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
}

/* ============================================================
   SSH CLIENT
   ============================================================ */

.ssh-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--window-bg, #1e1e2e);
    color: var(--text-primary, #cdd6f4);
    font-family: var(--ui-font, 'Segoe UI', sans-serif);
    overflow: hidden;
}

/* Connect panel */
.ssh-connect-panel {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.ssh-sidebar {
    width: 200px;
    min-width: 160px;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ssh-sidebar-title {
    padding: 12px 14px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
}

.ssh-connections-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.ssh-no-connections {
    padding: 12px 14px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    font-style: italic;
}

.ssh-connection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.ssh-connection-item:hover {
    background: rgba(255,255,255,0.07);
}

.ssh-connection-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.ssh-connection-info {
    flex: 1;
    min-width: 0;
}

.ssh-connection-label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #cdd6f4);
}

.ssh-connection-delete {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    opacity: 0;
}

.ssh-connection-item:hover .ssh-connection-delete {
    opacity: 1;
}

.ssh-connection-delete:hover {
    color: #f38ba8;
    background: rgba(243,139,168,0.15);
}

.ssh-new-btn {
    margin: 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--text-primary, #cdd6f4);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.ssh-new-btn:hover {
    background: rgba(255,255,255,0.13);
}

/* Form panel */
.ssh-form-panel {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ssh-form-title {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #cdd6f4);
}

.ssh-form-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 340px;
}

.ssh-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
}

.ssh-label-inline {
    max-width: 120px;
}

.ssh-label-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.ssh-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--text-primary, #cdd6f4);
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.ssh-input:focus {
    border-color: var(--accent-color, #89b4fa);
    background: rgba(0,0,0,0.4);
}

.ssh-input[type="number"] {
    width: 100px;
}

.ssh-save-check {
    accent-color: var(--accent-color, #89b4fa);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.ssh-form-actions {
    margin-top: 22px;
    max-width: 340px;
}

.ssh-connect-btn {
    padding: 9px 28px;
    background: var(--accent-color, #89b4fa);
    color: #1e1e2e;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.ssh-connect-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.ssh-connect-btn:active {
    transform: translateY(0);
}

.ssh-form-status {
    margin-top: 12px;
    font-size: 12px;
    min-height: 18px;
    max-width: 340px;
}

.ssh-form-status--info  { color: #89b4fa; }
.ssh-form-status--error { color: #f38ba8; }

/* Terminal panel */
.ssh-terminal-panel {
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ssh-terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    min-height: 36px;
}

.ssh-terminal-icon {
    font-size: 14px;
}

.ssh-terminal-info {
    flex: 1;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-family: 'Cascadia Code', Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssh-terminal-actions {
    display: flex;
    gap: 6px;
}

.ssh-new-session-btn,
.ssh-disconnect-btn {
    padding: 4px 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    color: var(--text-primary, #cdd6f4);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
}

.ssh-new-session-btn:hover {
    background: rgba(255,255,255,0.14);
}

.ssh-disconnect-btn {
    border-color: rgba(243,139,168,0.35);
    color: #f38ba8;
}

.ssh-disconnect-btn:hover {
    background: rgba(243,139,168,0.15);
}

.ssh-xterm-container {
    flex: 1;
    overflow: hidden;
    padding: 4px;
    background: #1e1e2e;
}

.ssh-xterm-container .xterm {
    height: 100%;
}

.ssh-xterm-container .xterm-viewport {
    overflow-y: auto;
}

/* Theme swatch badge (keep existing rule below) */
.theme-swatch-badge {
    color: var(--accent-color, #667eea);
    font-size: 10px;
    margin-top: 2px;
}
