/* ===========================================
   FONT DEFINITIONS
   =========================================== */

:root {
    --font-system: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell,
               "Noto Sans", "Helvetica Neue", Arial,
               "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji",
               sans-serif;
    --font-mono:  ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas,
               "Liberation Mono", "DejaVu Sans Mono", "Ubuntu Mono",
               "Droid Sans Mono", "Noto Mono", "Courier New", monospace;
}

/* Default font for the entire application */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-system);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Console/CLI specific font */
.cli-container,
.command-prompt,
.command-input,
.command-text {
    font-family: var(--font-mono);
    font-size: 13px;
    /*font-weight: 1.5;*/
    /*line-height: 1.5;*/
}

/* ===========================================
   CLI/CONSOLE STYLES
   =========================================== */

.cli-container {
    background-color: #ffffff;
    color: #000000;
    padding: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}


.command-output {
    margin: 0;
    padding: 0;
}

.command-output:empty {
    display: none;
}

.command-output.empty {
    display: none;
}

/****
/* Shrink the generated container (v2 = .dt-container; v1.x = .dataTables_wrapper) */
/*.dt-container,
.dataTables_wrapper {
  display: inline-block;      
  width: auto;                
}
****/

/***
Table command output
***/

.command-output table {
    border-collapse: collapse;
    margin: 0;
}

th + th,
td + td {
    border-left: 1px solid rgb(190, 190, 190);
}

.command-output table th {
    text-align: left;
    padding: 4px 12px;
    text-align: right;

}

.command-output table td {
    padding: 2px 12px;
    text-align: right;
}

.command-output table thead tr {
    border-bottom: 1px solid #000;
}

.command-prompt {
    font-weight: bold;
    white-space: pre;
}

.command-history {
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.command-history > :last-child .command-line-number {
    flex: 1;
    border-right: 1px solid #e0e0e0;
}

.command-entry {
    margin: 0;
    padding: 0;
    border: none;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease;
    overflow-x: auto;
    display: flex;
    align-items: stretch;
    position: relative;
}

.command-entry:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.command-line-number {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 40px;
    padding: 8px 8px 8px 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #999999;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    user-select: none;
    box-sizing: border-box;
}

.command-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    margin-left: 12px; /* Space between border line and content */
}

.command-entry:focus-within {
    background-color: #f8f9ff;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

.command-entry:focus-within:hover {
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.command-form {
    margin: 0;
    padding: 0;
}

.command-input, .command-text {
    background-color: transparent;
    border: none;
    color: blue;
    outline: none;
    margin: 0;
    padding: 0;
}

.command-input {
    flex: 1;
}

.command-form {
    display: flex;
    align-items: center;
}

/* ===========================================
   SIDEBAR STYLES
   =========================================== */

.sidebar {
    background-color: #f3f3f3;
    padding: 20px 0;
    height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
    /*border-right: 1px solid #e0e0e0;*/
}

.sidebar-split {
    height: 100%;
    width: 100%;
}

/*
.split-view-handle {
    background-color: #d0d0d0;
    transition: background-color 0.2s ease;
}

.split-view-handle:hover {
    background-color: #b0b0b0;
}
*/

/* ===========================================
   FILE UPLOAD STYLES
   =========================================== */

.file-upload-section {
    padding: 15px 20px;
}

.file-upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.file-upload-button:hover {
    background-color: #0056b3;
}

/***
These are status messages
***/

.selected-file {
    margin-top: 10px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.selected-file p {
    margin: 0;
    word-break: break-all;
}

.upload-status {
    margin-top: 10px;
    padding: 10px;
    background-color: #d4edda;
    border-radius: 5px;
    color: #155724;
}

.upload-status p {
    margin: 0;
    word-break: break-all;
}

/* ===========================================
   BUTTON STYLES
   =========================================== */

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.1s;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.08);
    opacity: 1;
}

.icon-button svg {
    width: 16px;
    height: 16px;
}

/* Toolbar button styles */
.toolbar-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgb(75, 85, 99);
}

.toolbar-button:hover {
    background-color: #e5e7eb;
}

.toolbar-button svg {
    width: 20px;
    height: 20px;
}

/* ===========================================
   FILE TREE STYLES
   =========================================== */

.file-tree {
    margin: 0;
    padding-top: 0;
}

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

.tree-header h3 {
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #6e6e6e;
}

/* Legacy refresh-button class for compatibility */
.refresh-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.1s;
    opacity: 0.7;
}

.refresh-button:hover {
    background-color: rgba(0, 0, 0, 0.08);
    opacity: 1;
}
.refresh-button svg {
    width: 16px;
    height: 16px;
}

.tree-loading {
    color: #6e6e6e;
    font-style: italic;
    padding: 10px 20px;
}

.tree-content {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.tree-content::-webkit-scrollbar {
    width: 10px;
}

.tree-content::-webkit-scrollbar-track {
    background: transparent;
}

.tree-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.tree-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 5px 28px 5px 28px;
    height: 22px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s;
    color: #333;
}

.tree-node:hover {
    background-color: #e8e8e8;
}

.tree-icon {
    margin-right: 6px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.tree-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 22px;
}

.tree-children {
    margin-left: 0;
}

/***
Plot command output
***/

.plot-output-container {
    margin: 0;
    padding: 0;
    width: 500px;
    height: 500px;
}


/**

Split view

**/

/* ===========================================
   EDITOR VIEW STYLES
   =========================================== */

.editor-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    min-height: 0;
}

/***
TABS STYLES
***/

.tabs-bar {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    min-height: 40px;
    align-items: stretch;
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-right: 1px solid #e0e0e0;
    cursor: pointer;
    background: #ffffff;
    min-width: 100px;
    max-width: 200px;
    position: relative;
}

.tab:hover {
    background: #ebebeb;
}

.tab.active {
    background: #ffffff;
    border-bottom: 2px solid #007bff;
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.tab-close {
    margin-left: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: #6e6e6e;
}

.tab-close:hover {
    background: #d0d0d0;
    color: #000000;
}

.tab-add {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
}

.tab-add:hover {
    background: #ebebeb;
    color: #000000;
}

.tab-content {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-placeholder,
.plot-placeholder,
.no-tabs {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    font-size: 13px;
}

/* Editor content styling */
.editor-content {
    background: #ffffff;
    color: #000000;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
}

.editor-content pre {
    margin: 0;
    padding: 10px;
}

.editor-content .loading {
    color: #6e6e6e;
    font-style: italic;
}

/* ===========================================
   DIALOG/POPUP STYLES
   =========================================== */

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-box {
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.dialog-content {
    margin-bottom: 20px;
}

.dialog-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    box-sizing: border-box;
}

.dialog-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dialog-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
}

.dialog-button-primary {
    background-color: #3b82f6;
    color: white;
}

.dialog-button-primary:hover {
    background-color: #2563eb;
}

.dialog-button-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.dialog-button-secondary:hover {
    background-color: #d1d5db;
}



/* ===========================================
   ADMIN VIEW STYLES - START
   Google Docs-style project selector
   =========================================== */

.admin-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8f9fa;
    overflow: hidden;
}

.admin-header {
    background: #ffffff;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    font-size: 24px;
    font-weight: 400;
    margin: 0;
    font-family: var(--font-system);
    display: flex;
    align-items: baseline;
}

.admin-title-brand {
    color: #007bff;
    font-weight: 500;
}

.admin-title-separator {
    color: #5f6368;
    margin: 0 4px;
}

.admin-title-section {
    color: #202124;
}

.admin-new-project-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-system);
}

.admin-new-project-btn:hover {
    background: #0056b3;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.admin-new-project-btn svg {
    width: 16px;
    height: 16px;
}

.admin-subheader {
    background: #ffffff;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-subheader-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}


.admin-view-toggle {
    display: flex;
    gap: 8px;
}

.admin-view-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #5f6368;
    transition: background-color 0.2s;
}

.admin-view-btn:hover {
    background: #f1f3f4;
}

.admin-view-btn.active {
    color: #007bff;
    background: #e8f0fe;
}

.admin-content {
    flex: 1;
    padding: 24px;
    overflow: auto;
    background: #f8f9fa;
}

.admin-projects-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.admin-project-card {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-project-card:hover {
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.admin-project-thumbnail {
    height: 120px;
    background: #f3f3f3;
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.admin-project-thumbnail-icon {
    width: 60px;
    height: 60px;
    background: #007bff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 500;
}

.admin-project-info {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admin-project-name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-system);
}

.admin-project-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.admin-project-id {
    font-size: 12px;
    font-family: var(--font-mono);
    color: #5f6368;
    padding: 2px 6px;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.admin-project-date {
    font-size: 12px;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* List view styles */
.admin-projects-list {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #dadce0;
}

.admin-list-header {
    display: grid;
    grid-template-columns: 1fr 150px;
    padding: 12px 24px;
    border-bottom: 1px solid #dadce0;
    font-size: 12px;
    color: #5f6368;
    font-weight: 500;
    text-transform: uppercase;
}

.admin-list-item {
    display: grid;
    grid-template-columns: 1fr 200px 150px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    align-items: center;
}

.admin-list-item-no-id {
    display: grid;
    grid-template-columns: 1fr 150px;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    align-items: center;
}

.admin-list-item:hover,
.admin-list-item-no-id:hover {
    background: #f8f9fa;
}

.admin-list-item:last-child,
.admin-list-item-no-id:last-child {
    border-bottom: none;
}

.admin-list-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-list-icon {
    width: 36px;
    height: 36px;
    background: #007bff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.admin-list-title {
    font-size: 14px;
    color: #202124;
    font-weight: 400;
}

.admin-list-id {
    font-size: 13px;
    color: #5f6368;
    font-family: var(--font-mono);
}

.admin-list-date {
    font-size: 13px;
    color: #5f6368;
}

/* Empty state */
.admin-empty-state {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
}

.admin-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    opacity: 0.5;
}

.admin-empty-icon svg {
    width: 100%;
    height: 100%;
    color: #5f6368;
}

.admin-empty-title {
    font-size: 20px;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: #202124;
}

.admin-empty-text {
    font-size: 14px;
    margin: 0 0 24px 0;
    line-height: 1.5;
    color: #5f6368;
}

/* Loading state */
.admin-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #5f6368;
    font-size: 14px;
}

.admin-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: admin-spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

/* Inline editing styles */
.admin-project-name-input {
    font-family: var(--font-system);
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    background: #fafafa;
    border: 1px solid #dadce0;
    border-radius: 3px;
    padding: 0 8px 0 0;
    margin: -1px 0 3px -1px; /* Compensate for border, no left padding shift */
    width: calc(100% - 8px); /* Account for right padding only */
    outline: none;
    line-height: 1.3;
    height: 20px;
    box-sizing: border-box;
}

.admin-list-name-input {
    font-family: var(--font-system);
    font-size: 14px;
    font-weight: 400; /* Match .admin-list-title */
    color: #202124;
    background: #fafafa;
    border: 1px solid #dadce0;
    border-radius: 3px;
    padding: 0 8px 0 0;
    margin: -1px 0 -1px -1px; /* Compensate for border, no left padding shift */
    outline: none;
    display: inline-block;
    width: auto;
    min-width: 150px;
    max-width: 280px; /* Slightly reduced to ensure space on right */
    line-height: 1.3;
    height: 20px;
    box-sizing: border-box;
}

.admin-project-name-input:focus,
.admin-list-name-input:focus {
    background: #fff;
    border-color: #007bff;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.15);
}

/* Make clickable project names more obvious */
.admin-project-name:hover,
.admin-list-title:hover {
    text-decoration: underline;
    text-decoration-color: #007bff;
    text-underline-offset: 2px;
    cursor: text;
}

/* Modal styles */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.admin-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14);
    width: 450px;
    max-width: 90%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-modal-title {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin: 0;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-modal-content {
    padding: 24px;
}

.admin-modal-label {
    display: block;
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 8px;
}

.admin-modal-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    font-family: var(--font-system);
    border: 1px solid #dadce0;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.admin-modal-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.15);
}

.admin-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
}

.admin-modal-button {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-system);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-cancel {
    background: transparent;
    color: #5f6368;
}

.admin-modal-cancel:hover {
    background: #f8f9fa;
}

.admin-modal-create {
    background: #007bff;
    color: white;
}

.admin-modal-create:hover:not(:disabled) {
    background: #0056b3;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3);
}

.admin-modal-create:disabled {
    background: #dadce0;
    color: #80868b;
    cursor: not-allowed;
}

.admin-modal-delete {
    background: #dc3545;
    color: white;
}

.admin-modal-delete:hover:not(:disabled) {
    background: #c82333;
}

.admin-modal-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.admin-project-card {
    position: relative;
}

.admin-project-card:hover .admin-delete-btn,
.admin-list-item-no-id:hover .admin-delete-btn {
    opacity: 1;
}

.admin-delete-btn:hover {
    background: #dc3545;
    color: white;
}

.admin-delete-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
}

.admin-list-item-no-id {
    position: relative;
}

.admin-list-delete-wrapper {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

/* ===========================================
   TOP BAR STYLES
   =========================================== */

.top-bar {
    background-color: white;
    padding: 8px 16px;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.top-bar button {
    border: 1px solid  #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    font-weight: bold;
}

.top-bar button.toolbar-text-button {
    padding: 6px 9px;
}

/* ===========================================
   ADMIN VIEW STYLES - END
   =========================================== */

/* ===========================================
   NOTEBOOK EDITOR STYLES - CSS COUNTER BASED
   =========================================== */

:root {
    --gutter-w: 32px;       /* reduced from 56px */
    --bg: #ffffff;          /* editor background - white to match app */
    --gutter-bg: #f8f9fa;   /* gutter background - light gray */
    --border: #e0e0e0;      /* subtle borders - match existing borders */
    --text: #000000;        /* main text - black */
    --muted: #999999;       /* gutter numbers - match existing muted text */
    --panel: rgba(0,0,0,0.02);
    --panel-bd: rgba(0,0,0,0.08);
    --radius: 4px;          /* smaller radius to match app style */
}

/* Editor container */
.editor {
    flex: 1 1 auto;
    min-height: 0; 
    padding: 16px 16px 32px calc(var(--gutter-w) + 8px); /* reduced left padding */
    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, "Liberation Mono",
                    "DejaVu Sans Mono", Consolas, "Courier New", monospace;
    counter-reset: cmd-line;
    overflow-y: auto; /* enable vertical scrolling */
}

/* Continuous gutter bar - removed */

/* One notebook cell = one numbered block */
.notebook-cell{
    position: relative;
    counter-increment: cmd-line;
    padding: 0;
    margin: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

/* Line number in the gutter */
/*.notebook-cell::before{
    content: counter(cmd-line);
    position: absolute;
    left: calc(-1 * var(--gutter-w));
    top: 0;
    width: var(--gutter-w);
    text-align: right;
    padding-right: 12px;
    color: var(--muted);
    user-select: none;
    z-index: 1;
    letter-spacing: 0.5px;
}*/

/* Focus/hover state to feel editor-y */
.notebook-cell:focus-within{
    box-shadow:
    0 0 0 1px rgba(59,130,246,0.35),   /* ring */
    0 0 6px 2px rgba(59,130,246,0.45);/* soft glow */
    border-radius: 5px;
}

/* Input / Output blocks */
.notebook-cell-input,
.notebook-cell-output{
    background: transparent;
    border: none;
    padding: 6px 18px;
    margin: 0;
}

.notebook-cell-input{
    outline: none;
    /* Allow editing feel without JS */
    white-space: pre-wrap;
    color: #222222;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.notebook-cell-input[contenteditable="true"]{
    caret-color: #000;
}

.notebook-cell-output{
    overflow: auto;
}

.notebook-cell-output pre{
    margin: 0;
    white-space: pre;     /* typical code output */
    tab-size: 4;
}

.notebook-cell-output.empty {
    display: none;
}

.notebook-cell-output * {
    margin: 0 !important;
}

/* Optional: nicer selection inside the editor */
.editor ::selection{
    background: rgba(0, 122, 204, 0.2);
}

/* Optional: start numbering at an arbitrary value using a data attribute */
.editor[data-start]{
    /* (data-start - 1) — cannot do arithmetic in pure CSS, so provide exact value in HTML if needed */
}
/* Example: to start at 10, set counter-reset manually on a custom class instead. */
.start-at-10{ 
    counter-reset: cmd-line 9; 
}

/* Maintain existing table styling for notebook cell outputs */
.notebook-cell-output table {
    border-collapse: collapse;
    margin: 0;
}

.notebook-cell-output table th + th,
.notebook-cell-output table td + td {
    border-left: 1px solid rgb(190, 190, 190);
}

.notebook-cell-output table th {
    text-align: left;
    padding: 4px 12px;
    text-align: right;
}

.notebook-cell-output table td {
    padding: 2px 12px;
    text-align: right;
}

.notebook-cell-output table thead tr {
    border-bottom: 1px solid #000;
}

.script-indicator {
    color: var(--muted);
    font-style: italic;
    font-size: 12px;
}

.error {
    color: #dc2626;
}

.tab-pane-visible {  
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tab-pane-hidden {
    display: none;
}

.admin-content,
.editor-view,
.tab-content {
  min-height: 0;
}