body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar h2, .sidebar h3 {
    color: #ecf0f1;
    border-bottom: 1px solid #34495e;
    padding-bottom: 10px;
    margin-top: 20px;
}

.sidebar ul, .sidebar ol {
    padding-left: 20px;
    line-height: 1.6;
    font-size: 14px;
}

.info-content {
    flex: 1;
}

/* Login in Sidebar */
#login-section {
    margin-top: 20px;
    background: #34495e;
    padding: 15px;
    border-radius: 8px;
}

#password-input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    box-sizing: border-box;
}

#login-btn {
    width: 100%;
    padding: 10px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#login-btn:hover {
    background-color: #2ecc71;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ecf0f1;
    display: flex;
    flex-direction: column;
}

#app-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.stats-bar {
    display: flex;
    gap: 15px;
    font-size: 14px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
}

.stats-bar b { font-weight: bold; }
.stats-bar .success { color: #28a745; }
.stats-bar .warning { color: #ffc107; }
.stats-bar .error { color: #dc3545; }

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.file-select-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: background 0.2s;
}

.btn-primary:hover { background-color: #0056b3; }
.btn-info { background-color: #17a2b8; }
.btn-info:hover { background-color: #117a8b; }

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f3f5;
    padding: 5px 10px;
    border-radius: 4px;
}

#start-btn { background-color: #28a745; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
#start-btn:hover { background-color: #218838; }
#start-btn:disabled { background-color: #ccc; cursor: not-allowed; }

#stop-btn { background-color: #dc3545; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
#stop-btn:hover { background-color: #c82333; }
#stop-btn:disabled { background-color: #ccc; cursor: not-allowed; }

.export-group { display: flex; gap: 5px; }
.export-group button {
    padding: 8px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.export-group button:hover:not(:disabled) { background-color: #5a6268; }
.export-group button:disabled { background-color: #e2e6ea; color: #adb5bd; cursor: not-allowed; }

/* Split View */
.split-view {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden; /* Ensure split view doesn't overflow parent */
}

.table-view {
    flex: 2;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.log-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #2b2b2b;
    color: #f8f8f2;
}

.log-view h3 {
    margin: 0;
    padding: 10px;
    background: #3c3f41;
    font-size: 14px;
    border-bottom: 1px solid #555;
    color: #eee;
}

#log-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    line-height: 1.4;
}

.log-entry { margin-bottom: 4px; border-bottom: 1px solid #333; padding-bottom: 2px; }
.log-entry.info { color: #81a1c1; }
.log-entry.success { color: #a3be8c; }
.log-entry.warn { color: #ebcb8b; }
.log-entry.error { color: #bf616a; }
.log-entry.system { color: #88c0d0; font-weight: bold; }
.log-time { color: #666; margin-right: 5px; font-size: 11px; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.status-pending { color: #6c757d; }
.status-running { color: #007bff; font-weight: bold; }
.status-done { color: #28a745; font-weight: bold; }
.status-check { color: #ffc107; font-weight: bold; }
.status-error { color: #dc3545; font-weight: bold; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
