:root {
    --bg: #0f0f11;
    --panel-bg: #1e1e24;
    --border: #2d2d35;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #ffffff;
    --online: #03dac6;
    --offline: #cf6679;
    --btn-bg: #2d2d35;
    --btn-hover: #3d3d45;
    --danger: #cf6679;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    background-color: var(--bg); 
    color: var(--text); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
}

#loginScreen { 
    background: var(--panel-bg); 
    padding: 40px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
}
#loginScreen h1 { margin-bottom: 20px; font-weight: 500; }
input { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 15px; 
    background: var(--bg); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    color: white; 
    outline: none; 
}
input:focus { border-color: var(--text-muted); }
button { 
    width: 100%; 
    padding: 12px; 
    background: var(--accent); 
    color: black; 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s; 
}
button:hover { background: #ccc; }

#dashboard { 
    display: none; 
    width: 100%; 
    max-width: 1200px; 
    padding: 20px; 
}
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 20px; 
}
.header h1 { font-size: 24px; font-weight: 500; }
.logout-btn { 
    width: auto; 
    padding: 8px 16px; 
    background: transparent; 
    border: 1px solid var(--border); 
    color: var(--text); 
}
.logout-btn:hover { background: var(--btn-hover); color: white; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: var(--panel-bg); 
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid var(--border); 
}
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #25252d; cursor: pointer; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.offline { background: var(--offline); }

#botModal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
}
.modal-content { 
    background: var(--panel-bg); 
    width: 90%; 
    max-width: 900px; 
    max-height: 90vh; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}
.modal-header { 
    padding: 20px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.modal-body { 
    padding: 20px; 
    display: flex; 
    gap: 20px; 
    flex: 1; 
    min-height: 0; 
}
.sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    min-width: 200px; 
}
.sidebar button { 
    background: var(--btn-bg); 
    color: var(--text); 
    border: 1px solid var(--border); 
    text-align: left; 
}
.sidebar button:hover { background: var(--btn-hover); }
.sidebar button.danger { color: var(--danger); border-color: var(--danger); }
.sidebar button.danger:hover { background: rgba(207, 102, 121, 0.1); }

.content-area { 
    flex-grow: 1; 
    background: var(--bg); 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    min-height: 0; 
    overflow: hidden; 
}

#terminalOutput { 
    flex-grow: 1; 
    padding: 15px; 
    font-family: 'Courier New', monospace; 
    font-size: 14px; 
    color: #00ff00; 
    overflow-y: auto; 
    white-space: pre-wrap; 
}
.terminal-input-row { display: flex; border-top: 1px solid var(--border); }
.terminal-input-row input { border: none; border-radius: 0; background: #151518; margin: 0; }
.terminal-input-row button { border-radius: 0; width: auto; padding: 0 20px; }

#screenImage {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    padding: 10px;
}
#screenImage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.screen-stub { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100%; 
    color: var(--text-muted); 
    font-style: italic; 
}

/* === ФИКС ТАБЛИЦЫ ФАЙЛОВ === */
#fileList {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}
#fileList table {
    width: 100%;
    table-layout: fixed; /* Жестко фиксируем колонки */
}
#fileList td {
    padding: 8px;
    border-bottom: 1px solid #2d2d35;
    white-space: nowrap;      /* Запрещаем перенос строк */
    overflow: hidden;         /* Скрываем то, что не влезло */
    text-overflow: ellipsis;  /* Добавляем троеточие (...) */
}
#fileList td:last-child {
    width: 150px;             /* Расширили колонку под 2 кнопки */
    text-align: right;
    overflow: visible;        /* Кнопку не обрезаем */
}
