﻿:root {
    --bg: #eaf4fb;
    --panel: #ffffff;
    --border: #d6e4ef;
    --text: #1f2d3d;
    --muted: #51606d;
    --primary: #c62828;
    --primary-dark: #a91f1f;
    --secondary: #4a6f8a;
    --secondary-dark: #39586e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

body.is-running {
    cursor: wait;
}

.app-shell {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    padding: 16px;
}

.sidebar {
    background: var(--panel);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 32px);
}

.brand-block {
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.brand-link-form {
    margin: 0;
}

.brand-link-btn {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: inherit;
}

.logo {
    width: 170px;
    max-width: 100%;
    margin-bottom: 6px;
}

h1 {
    margin: 0;
    font-size: 30px;
}

h2 {
    margin: 0 0 8px 0;
    font-size: 19px;
}

h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
}

.subtitle {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--muted);
}

.menu-block {
    margin-bottom: 14px;
}

.object-list {
    display: grid;
    gap: 8px;
}

.object-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 6px 10px;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}

.object-btn:hover {
    background: var(--primary-dark);
}

.object-btn.active {
    outline: 2px solid #7a1313;
}

.disabled-btn {
    background: #d9a4a4;
    cursor: not-allowed;
}

.menu-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9fcff;
}

.menu-meta {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.input-doc-card {
    background: #f4f9ff;
    border-color: #cddff0;
}

.input-doc-card h3 {
    margin-bottom: 6px;
}

.input-doc-links a {
    color: #2f5f8a;
}

input[type="file"],
textarea {
    width: 100%;
    border: 1px solid #b8c7d1;
    border-radius: 6px;
    background: #ffffff;
    padding: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    font-family: Arial, sans-serif;
}

.btn {
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn:disabled {
    background: #cfa3a3;
    cursor: not-allowed;
}

.secondary-btn {
    background: var(--secondary);
}

.secondary-btn:hover {
    background: var(--secondary-dark);
}

.actions-block {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

.workspace-top,
.workspace-bottom {
    background: var(--panel);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 6px 10px;
    overflow: hidden;
}

.status-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-right form {
    margin: 0;
}

.status-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid #c9d8e5;
    background: #fff;
}

.status-chip {
    font-size: 11px;
    line-height: 1.1;
    background: #f3f8fd;
    border: 1px solid #d8e7f3;
    border-radius: 999px;
    padding: 4px 8px;
    color: #344a5c;
    max-width: 290px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-message {
    margin-top: 8px;
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 12px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.panel-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.message {
    background: #ffffff;
    border-left: 5px solid var(--primary);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 14px;
}

.muted-card {
    background: #f8fbfe;
}

.table-wrapper {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: calc(100vh - 205px);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    border: 1px solid var(--border);
    padding: 8px 9px;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}

th {
    background: #eef7ff;
    position: sticky;
    top: 0;
    z-index: 4;
}

.frozen-col {
    position: sticky;
    z-index: 2;
    background: #ffffff;
}

th.frozen-col {
    z-index: 6;
    background: #eef7ff;
}

.frozen-col.frozen-col-3 {
    box-shadow: 2px 0 0 #cfe3f2;
}

.duplicate-row td {
    background-color: #ffd6d6;
    color: #1f2d3d;
    font-weight: 600;
}

.duplicate-row td.frozen-col {
    background-color: #ffd6d6;
}

.untested-row td {
    background-color: #f2f4f6;
    color: #9aa3ad;
    font-weight: 400;
}

.untested-row td.frozen-col {
    background-color: #f2f4f6;
}

.preview-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.running-indicator {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(20, 35, 48, 0.46);
    backdrop-filter: blur(1px);
    z-index: 9999;
}

.running-indicator.active {
    display: flex;
}

.running-indicator-box {
    min-width: 280px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 12px auto;
    border: 4px solid #e4ecf3;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinner-rotate 0.9s linear infinite;
}

.running-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--text);
}

.running-subtitle {
    font-size: 14px;
    color: var(--muted);
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        max-height: none;
    }

    .workspace {
        grid-template-rows: auto 1fr;
        min-height: auto;
    }

    .table-wrapper {
        max-height: 60vh;
    }
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
}


.preview-controls-label {
    font-size: 11px;
    color: var(--muted);
    margin-right: 2px;
}


.preview-links {
    font-size: 11px;
}

.preview-link {
    font-size: 11px;
    color: #2f5f8a;
    text-decoration: underline;
}

.preview-link.active {
    color: #0d3555;
    font-weight: 700;
    text-decoration: none;
}

.preview-mini-btn {
    border: 1px solid #c8d9e7;
    background: #f7fbff;
    color: #2f5f8a;
    font-size: 11px;
    line-height: 1;
    border-radius: 999px;
    padding: 4px 8px;
    cursor: pointer;
}

.preview-mini-btn:hover {
    background: #eef7ff;
}

.preview-mini-btn.active {
    background: #dff0ff;
    border-color: #9fc2de;
    color: #0d3555;
    font-weight: 700;
}

.preview-mini-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.preview-sep {
    color: #8aa0b3;
    font-size: 10px;
}

.active-filters-summary {
    font-size: 11px;
    color: var(--muted);
    margin-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}


.memory-form {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.memory-select {
    width: 100%;
    border: 1px solid #b8c7d1;
    border-radius: 6px;
    background: #ffffff;
    padding: 7px;
    font-size: 12px;
    font-family: Arial, sans-serif;
}



.popup-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px auto;
}


.version-badge {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 10000;
    font-size: 11px;
    font-weight: 700;
    color: #1d3b52;
    background: #f4faff;
    border: 1px solid #cfe3f2;
    border-radius: 999px;
    padding: 3px 8px;
}


.workspace-top {
    overflow: visible;
}

.workspace-bottom {
    overflow-y: auto;
    overflow-x: hidden;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
}


.table-clickable {
    cursor: pointer;
}

.table-clickable.filtered {
    background: #dff0ff;
}

.table-clickable.sorted-asc::after {
    content: " ▲";
    font-size: 10px;
    color: #2f5f8a;
}

.table-clickable.sorted-desc::after {
    content: " ▼";
    font-size: 10px;
    color: #2f5f8a;
}

.table-menu {
    position: fixed;
    z-index: 13000;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid #cfe3f2;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    padding: 4px;
}

.table-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 7px 8px;
    font-size: 12px;
    color: #1f2d3d;
    cursor: pointer;
}

.table-menu button:hover {
    background: #eef7ff;
}


.upload-help-link a {
    color: #2f5f8a;
    text-decoration: underline;
    font-size: 12px;
}

.workspace-help-card {
    margin-top: 8px;
    border: 1px solid #cddff0;
    border-radius: 8px;
    background: #f4f9ff;
    padding: 6px 10px;
}

.workspace-help-summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #1f2d3d;
    list-style: none;
    outline: none;
}

.workspace-help-summary::-webkit-details-marker {
    display: none;
}

.workspace-help-summary::before {
    content: "+ ";
    color: #2f5f8a;
    font-weight: 700;
}

.workspace-help-card[open] .workspace-help-summary::before {
    content: "- ";
}

.workspace-help-content {
    margin-top: 6px;
}

