:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --line: rgba(0, 0, 0, 0.06);
    --text: #1f1f1f;
    --muted: #666666;
    --accent: #1890ff;
    --accent-strong: #096dd9;
    --hover-bg: rgba(132, 133, 141, 0.12);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
}

[v-cloak] {
    display: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 20px;
    background: #ffffff;
    border-right: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.sidebar h1,
.content h2 {
    margin: 0;
}

.sidebar-copy,
.landing-card p,
.user-card p,
.label,
.eyebrow {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--line);
}

.user-card,
.landing-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafafa;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav-button,
.ghost-button,
.primary-button,
.table-link {
    border: none;
    transition: all 0.2s ease;
}

.nav-button {
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-weight: 500;
}

.nav-button.active,
.nav-button:hover {
    background: rgba(24, 144, 255, 0.12);
    color: var(--accent-strong);
}

.ghost-button,
.primary-button {
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 500;
}

.ghost-button {
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent-strong);
}

.nav-anchor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ghost-button:hover,
.primary-button:hover,
.table-link:hover {
    opacity: 0.85;
}

.ghost-button.compact {
    padding: 6px 12px;
    border-radius: 10px;
}

.ghost-button.danger {
    color: #cf1322;
    background: rgba(207, 19, 34, 0.08);
}

.ghost-button:disabled,
.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-button {
    background: var(--accent);
    color: #fff;
}

.content {
    padding: 28px;
    display: grid;
    gap: 20px;
    align-content: start;
}

.panel,
.flash {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.panel-wide {
    min-height: 420px;
}

.panel-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
}

.panel-header,
.toolbar,
.path-bar,
.actions,
.search-form {
    display: flex;
    gap: 12px;
}

.header-actions,
.inline-search,
.path-summary,
.search-panel-header,
.search-result-item,
.file-entry,
.file-entry-text {
    display: flex;
    gap: 12px;
}

.panel-header {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.header-actions {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.inline-search {
    align-items: center;
    min-width: min(100%, 460px);
}

.inline-search input {
    min-width: 240px;
}

.label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flash {
    padding: 12px 16px;
}

.flash.success {
    border-color: #b7eb8f;
    color: #389e0d;
    background: #f6ffed;
}

.flash.error {
    border-color: #ffa39e;
    color: #cf1322;
    background: #fff1f0;
}

.flash.info {
    border-color: #91caff;
    color: #0958d9;
    background: #e6f4ff;
}

.login-form,
.stack-form {
    display: grid;
    gap: 16px;
}

.login-form {
    max-width: 420px;
}

.stack-form label,
.login-form label {
    display: grid;
    gap: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f0f2f5;
    color: var(--text);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
}

textarea {
    resize: vertical;
}

.toggle {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
}

.toggle input {
    width: 18px;
    height: 18px;
}

.path-bar input {
    background: #f0f2f5;
}

.path-bar {
    align-items: center;
    flex-wrap: wrap;
}

.path-summary {
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(24, 144, 255, 0.06);
}

.path-label {
    color: var(--muted);
    font-size: 13px;
}

.search-panel {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f5f5f5;
}

.search-panel-header {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.search-results {
    display: grid;
    gap: 10px;
}

.search-result-item {
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.search-result-main {
    display: grid;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.search-result-main span,
.search-result-meta,
.file-entry-sub,
.muted-inline {
    color: var(--muted);
    font-size: 13px;
}

.search-result-meta {
    white-space: nowrap;
}

.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    font-size: 20px;
    flex: 0 0 28px;
}

.empty-state {
    padding: 28px 16px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--hover-bg);
}

.table-link {
    padding: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(24, 144, 255, 0.06);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.option-chip strong {
    color: var(--text);
    font-weight: 600;
}

.file-entry {
    align-items: center;
    width: 100%;
}

.file-entry-text {
    align-items: flex-start;
    flex-direction: column;
    min-width: 0;
}

.highlighted {
    background: rgba(24, 144, 255, 0.08);
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 10px;
}

@media (max-width: 1080px) {
    .shell,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .content {
        padding: 18px;
    }

    .sidebar {
        padding: 20px 16px;
    }

    .panel {
        padding: 18px;
        border-radius: 16px;
    }

    .panel-header,
    .toolbar,
    .search-form,
    .header-actions,
    .inline-search {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-search input {
        min-width: 0;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table td,
    .data-table th {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
    }

    .data-table td {
        border-bottom: none;
        padding: 6px 0;
    }

    .search-result-item {
        align-items: flex-start;
        flex-direction: column;
    }
}
