#sketches-pane {
    display: grid;
    grid-template-columns: calc(200px + 5vw) auto;
    grid-template-rows: 100vh;
    overflow: hidden;
}

#sketches-pane > .column {
    grid-column: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

#sketches-pane > .column::-webkit-scrollbar {
    display: none;
}

.sub-pane {
    grid-column: 2;
    background-color: var(--fill-color-1);
    padding: 3vw 5vw;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--gradient);
    background-attachment: fixed;
}

table#sketch-list::before {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    width: calc(90vw - 400px);
    height: calc(3vw + var(--border-radius));
    background-color: var(--fill-color-1);
    background: var(--gradient);
    background-attachment: fixed;
}


table#sketch-list {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    position: relative;
}

table#sketch-list th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    box-shadow: 0px 5px 0px var(--shadow-color);
}

table#sketch-list th, #sketch-list td {
    padding: 20px;
    background-color: var(--fill-color-2);
    /* border-top: 1px solid var(--shadow-color); */
    font-size: 16px;
    transition: border-radius var(--nav-transition-length), margin var(--nav-transition-length);
    z-index: 2;
    min-height: 62px;
    color: var(--text-color-1);
    border: 1px solid #ececec;
}

table#sketch-list .spacer td {
    padding: 0;
    min-height: 5px;
    height: 5px;
    border-bottom: 0;
    border-top: 0;
}

table#sketch-list tr.spacer + tr td {
    border-top: 0;
}

table#sketch-list th {
    font-variant: small-caps;
    text-transform: lowercase;
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

table#sketch-list tr:first-child td, table#sketch-list tr:first-child th {
    border-top: 0;
}

table#sketch-list tr td:first-child, table#sketch-list tr th:first-child {
    border-left: 0;
}

table#sketch-list tr td:last-child, table#sketch-list tr th:last-child {
    border-right: 0;
}

table#sketch-list tr:last-child td {
    border-bottom: 0;
    box-shadow: 0px 5px 0px var(--shadow-color);
}

table#sketch-list th:first-child {
    border-radius: var(--border-radius) 0 0 0;
}

table#sketch-list th:last-child {
    border-radius: 0 var(--border-radius) 0 0;
}

table#sketch-list tr:last-child td:first-child {
    border-radius: 0 0 0 var(--border-radius);
}

table#sketch-list tr:last-child td:last-child {
    border-radius: 0 0 var(--border-radius) 0;
}

table#sketch-list tr:last-child td[colspan="2"] {
    text-align: center;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Subject Pane - shares same layout as sketches pane */
#subject-pane {
    display: grid;
    grid-template-columns: calc(200px + 5vw) auto;
    grid-template-rows: 100vh;
    overflow: hidden;
}

#subject-pane > .column {
    grid-column: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#subject-pane > .column::-webkit-scrollbar {
    display: none;
}

/* Documents list table */
table#documents-list::before {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    width: calc(90vw - 400px);
    height: calc(3vw + var(--border-radius));
    background-color: var(--fill-color-1);
    background: var(--gradient);
    background-attachment: fixed;
}

table#documents-list {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    position: relative;
}

table#documents-list th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    box-shadow: 0px 5px 0px var(--shadow-color);
}

table#documents-list th, #documents-list td {
    padding: 20px;
    background-color: var(--fill-color-2);
    font-size: 16px;
    transition: border-radius var(--nav-transition-length), margin var(--nav-transition-length);
    z-index: 2;
    min-height: 62px;
    color: var(--text-color-1);
    border: 1px solid #ececec;
}

table#documents-list .spacer td {
    padding: 0;
    min-height: 5px;
    height: 5px;
    border-bottom: 0;
    border-top: 0;
}

table#documents-list tr.spacer + tr td {
    border-top: 0;
}

table#documents-list th {
    font-variant: small-caps;
    text-transform: lowercase;
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

table#documents-list tr:first-child td, table#documents-list tr:first-child th {
    border-top: 0;
}

table#documents-list tr td:first-child, table#documents-list tr th:first-child {
    border-left: 0;
}

table#documents-list tr td:last-child, table#documents-list tr th:last-child {
    border-right: 0;
}

table#documents-list tr:last-child td {
    border-bottom: 0;
    box-shadow: 0px 5px 0px var(--shadow-color);
}

table#documents-list th:first-child {
    border-radius: var(--border-radius) 0 0 0;
}

table#documents-list th:last-child {
    border-radius: 0 var(--border-radius) 0 0;
}

table#documents-list tr:last-child td:first-child {
    border-radius: 0 0 0 var(--border-radius);
}

table#documents-list tr:last-child td:last-child {
    border-radius: 0 0 var(--border-radius) 0;
}

table#documents-list tr:last-child td[colspan="2"] {
    text-align: center;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Document row hover effect */
table#documents-list tr.document-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

table#documents-list tr.document-row:hover td {
    background-color: var(--fill-color-1);
}

/* Chapter list item loading state */
#chapters-list li.loading {
    color: var(--text-color-2);
    font-style: italic;
}

/* ========================================
   Sketches Browser View (new admin panel)
   ======================================== */

.sketches-container {
    display: flex;
    height: 100%;
    gap: 20px;
    padding: 40px 40px 40px 20px;
}

.sketches-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--code-border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 0 4px inset rgba(100, 100, 100, 0.08), 0 0 40px inset rgba(100, 100, 100, 0.04);
}

.sketches-sidebar h2 {
    font-size: 0.85rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
    font-weight: normal;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s, color 0.2s;
    color: rgba(255, 255, 255, 0.7);
}

.categories-list li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.categories-list li.active {
    background: rgba(160, 218, 0, 0.2);
    color: #a0da00;
}

.categories-list li.error {
    color: #f66;
    font-style: italic;
}

.sketches-main {
    flex: 1;
    display: flex;
    gap: 20px;
    min-width: 0;
}

.sketches-list-panel {
    width: 250px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--code-border-color);
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 0 0 4px inset rgba(100, 100, 100, 0.08), 0 0 40px inset rgba(100, 100, 100, 0.04);
}

.sketches-list-panel h2 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: white;
    font-weight: normal;
}

#sketches-view .sketches-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sketches-view .sketches-list li {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s, color 0.2s;
    color: rgba(255, 255, 255, 0.7);
}

#sketches-view .sketches-list li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#sketches-view .sketches-list li.active {
    background: rgba(160, 218, 0, 0.2);
    color: #a0da00;
}

#sketches-view .sketches-list li.empty,
#sketches-view .sketches-list li.error {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    cursor: default;
}

#sketches-view .sketches-list li.error {
    color: #f66;
}

.sketch-preview-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--code-border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 0 4px inset rgba(100, 100, 100, 0.08), 0 0 40px inset rgba(100, 100, 100, 0.04);
}

.sketch-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sketch-preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    font-weight: normal;
}

.sketch-preview-actions {
    display: none;
    gap: 8px;
    padding: 0 0 15px 0;
}

.sketch-preview-actions.visible {
    display: flex;
}

.btn-edit-sketch {
    padding: 8px 16px;
    background: rgba(160, 218, 0, 0.3);
    color: #a0da00;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
    border: 1px solid rgba(160, 218, 0, 0.4);
}

.btn-edit-sketch:hover {
    background: rgba(160, 218, 0, 0.4);
}

.btn-delete-sketch {
    padding: 8px 16px;
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-sketch:hover {
    background: rgba(244, 67, 54, 0.3);
}

.btn-copy-ref {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-ref:hover {
    background: rgba(255, 255, 255, 0.15);
}

.delete-category-item {
    padding: 15px 0 0 0;
    list-style: none;
}

.btn-delete-category {
    padding: 8px 16px;
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-category:hover {
    background: rgba(244, 67, 54, 0.3);
}

.sketch-preview-container {
    flex: 1;
    background: #1a1a2e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
}

.sketch-preview-container.loading {
    opacity: 0.5;
}

.sketch-preview-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.sketch-preview-placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.sketch-preview-container .error {
    color: #f66;
}

.sketch-params-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sketch-params-section h4 {
    font-size: 0.85rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    font-weight: normal;
}

#sketch-params-input {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    padding: 10px;
    resize: vertical;
    box-sizing: border-box;
}

#sketch-params-input::placeholder {
    color: #555;
}

.btn-apply-params {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.btn-apply-params:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}