.admin-badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#admin-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--header-h));
}

#admin-nav {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

#admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.behavior-card-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.behavior-card-summary .bcs-none {
    color: var(--text-muted);
    font-size: 13px;
}

.behavior-card-summary .bcs-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 4px;
}

.behavior-card-summary .bcs-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.beh-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: all 0.15s;
    cursor: pointer;
}

.beh-card:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.beh-card.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.beh-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    background: var(--border);
}

.beh-card.is-active .beh-indicator {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.beh-info {
    flex: 1;
    min-width: 0;
}

.beh-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.beh-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.beh-preview {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    white-space: pre-wrap;
    max-height: 60px;
    overflow: hidden;
    line-height: 1.5;
}

.beh-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.beh-action-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.beh-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.beh-action-btn.danger:hover {
    background: var(--error-soft);
    color: var(--error);
    border-color: var(--error);
}

.editor-form {
    max-width: 900px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-textarea {
    width: 100%;
    min-height: 400px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    tab-size: 4;
}

.form-textarea:focus {
    border-color: var(--accent);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.toggle-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--accent);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

.recent-ws-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.recent-ws-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.recent-ws-row:last-child {
    border-bottom: none;
}

.recent-ws-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.recent-ws-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.recent-ws-date {
    font-size: 11px;
    color: var(--text-muted);
}

.empty-behaviors {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-behaviors p {
    margin-bottom: 16px;
    font-size: 14px;
}

@media (max-width: 800px) {
    #admin-layout {
        flex-direction: column;
    }
    #admin-nav {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    #admin-content {
        padding: 16px;
    }
}
