:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --bg-light: #2d2d2d;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --border: #333333;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: var(--bg-dark); color: var(--text-main); height: 100vh; overflow: hidden; }

/* Screens */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* Login */
#login-screen { justify-content: center; align-items: center; }
.login-box { background: var(--bg-panel); padding: 40px; border-radius: 8px; text-align: center; width: 100%; max-width: 400px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.login-box h2 { margin-bottom: 5px; color: var(--primary); }
.login-box p { color: var(--text-muted); margin-bottom: 20px; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border); background: var(--bg-dark); color: white; border-radius: 4px; }
.login-box button { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; transition: 0.2s; }
.login-box button:hover { background: var(--primary-hover); }
.error-msg { color: var(--danger); margin-top: 10px; font-size: 14px; }

/* Sidebar */
.sidebar { width: 250px; background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.brand { padding: 20px; font-size: 20px; font-weight: bold; color: var(--primary); border-bottom: 1px solid var(--border); }
.nav-links { list-style: none; flex: 1; }
.nav-links li { padding: 15px 20px; cursor: pointer; transition: 0.2s; color: var(--text-muted); border-bottom: 1px solid #222; }
.nav-links li i { margin-right: 10px; width: 20px; text-align: center; }
.nav-links li:hover, .nav-links li.active { background: var(--bg-light); color: var(--text-main); border-left: 4px solid var(--primary); }
#logout-btn { color: var(--danger); border-top: 1px solid var(--border); margin-top: auto; border-bottom: none; }

/* Content Area */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-dark); }
.tab-content { display: none; height: 100%; flex-direction: column; }
.tab-content.active { display: flex; }

/* Buttons */
button { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; color: white; font-weight: 500; transition: 0.2s; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-small { padding: 5px 10px; font-size: 12px; }

/* File Manager */
.top-bar { padding: 15px; background: var(--bg-panel); display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); }
.path-nav { display: flex; gap: 10px; flex: 1; max-width: 60%; }
.path-nav input { flex: 1; padding: 8px; background: var(--bg-dark); color: white; border: 1px solid var(--border); border-radius: 4px; }
.path-nav button { background: var(--bg-light); border: 1px solid var(--border); }
.file-actions { display: flex; gap: 10px; }

.files-container { display: flex; flex: 1; overflow: hidden; }
.shortcuts-bar { width: 200px; background: var(--bg-panel); border-right: 1px solid var(--border); padding: 15px; overflow-y: auto; }
.shortcuts-bar h3 { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; }
#shortcuts-list { list-style: none; margin-bottom: 15px; }
#shortcuts-list li { padding: 8px; cursor: pointer; font-size: 14px; border-radius: 4px; margin-bottom: 5px; background: var(--bg-light); word-break: break-all;}
#shortcuts-list li:hover { background: var(--primary); }

.file-list-area { flex: 1; overflow-y: auto; padding: 15px; }
.file-table { width: 100%; border-collapse: collapse; text-align: left; }
.file-table th, .file-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.file-table th { color: var(--text-muted); font-weight: 500; position: sticky; top: 0; background: var(--bg-dark); }
.file-table tr:hover { background: var(--bg-light); }
.icon-folder { color: #facc15; margin-right: 8px; }
.icon-file { color: #9ca3af; margin-right: 8px; }

/* Terminal */
.terminal-container { flex: 1; background: #000; padding: 20px; font-family: 'Consolas', monospace; display: flex; flex-direction: column; overflow: hidden; }
.terminal-output { flex: 1; overflow-y: auto; color: #0f0; white-space: pre-wrap; font-size: 14px; margin-bottom: 10px; }
.terminal-input-line { display: flex; align-items: center; color: #0f0; font-size: 14px; }
.terminal-input-line .prompt { margin-right: 10px; }
.terminal-input-line input { flex: 1; background: transparent; border: none; color: #fff; font-family: 'Consolas', monospace; font-size: 14px; outline: none; }

/* Database */
#tab-db { padding: 20px; overflow-y: auto; }
.db-form { background: var(--bg-panel); padding: 20px; border-radius: 8px; display: flex; flex-direction: column; gap: 10px; max-width: 400px; margin-bottom: 20px; }
.db-form input { padding: 10px; background: var(--bg-dark); border: 1px solid var(--border); color: white; border-radius: 4px; }
.db-query-area { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
#db-query { padding: 15px; background: #1e1e1e; color: #0f0; font-family: monospace; border: 1px solid var(--border); border-radius: 4px; resize: vertical; }
.db-results { overflow-x: auto; background: var(--bg-panel); border-radius: 8px; padding: 15px; }
.db-table { width: 100%; border-collapse: collapse; }
.db-table th, .db-table td { padding: 10px; border: 1px solid var(--border); }
.db-table th { background: var(--bg-light); }

/* Modal */
.modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.8); z-index: 1000; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-panel); width: 80%; height: 80%; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; }
.modal-header { padding: 15px; background: var(--bg-light); display: flex; justify-content: space-between; align-items: center; }
.close-modal { cursor: pointer; font-size: 24px; font-weight: bold; }
#file-editor { flex: 1; background: #1e1e1e; color: #d4d4d4; font-family: monospace; padding: 15px; border: none; resize: none; outline: none; }
.modal-footer { padding: 15px; background: var(--bg-light); text-align: right; }
